topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday April 24, 2024, 2:50 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Another Little modification to menuak.ahk  (Read 2763 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Another Little modification to menuak.ahk
« on: June 10, 2012, 04:20 PM »
I would like to assign a light color definable to each launch option...

 :-[

This is the initial code. Produces options in grey. Perhaps is needed a third option to select background color :
1. Button Title
2. Program to run
3. Color for background selection....

  
Code: Autohotkey [Select]
  1. IniRead, numRows, launcher.ini, General, numRows, 0
  2. IniRead, numCols, launcher.ini, General, numCols, 0
  3. if !numRows
  4.   InputBox, numRows, , Enter number of rows   , , 200, 120, , , , , 5
  5. if !numCols
  6.   InputBox, numCols, , Enter number of columns, , 200, 120, , , , , 2
  7. IniWrite, %numRows%, launcher.ini, General, numRows
  8. IniWrite, %numCols%, launcher.ini, General, numCols
  9.  
  10. Loop % numRows*numCols
  11. {
  12.   IniRead, Title%A_Index%, launcher.ini, Titles, Title%A_Index%, %A_Index%
  13.   IniRead, Path%A_Index%, launcher.ini, Paths, Path%A_Index%,
  14. }
  15.  
  16. Gui, Add, Button, w150 r1.5 gRun vButt1, %Title1%
  17. Gui, Add, Button, w40 hp xp+150 gEdit vEdit1, Edit
  18. Edit1:=1
  19. Butt1:=1
  20.  
  21. Loop % numRows*numCols-1
  22. {
  23.   Index:=A_Index+1
  24.   Title:=Title%Index%
  25.   ys:=!Mod(Index-1, numRows) ? "ys" : "xp-150 yp+35"
  26.   Gui, Add, Button, w150 hp %ys% gRun vButt%Index%, %Title%
  27.   Gui, Add, Button, w40 hp xp+150 gEdit vEdit%Index%, Edit
  28.   Edit%Index%:=Index
  29.   Butt%Index%:=Index
  30. }
  31.  
  32. Gui, Show, , Menu expedientes
  33.  
  34. Gui 2:+owner
  35. Gui 2:Add, Text, right, Button title:
  36. Gui 2:Add, Text, right, Program to run:
  37. Gui 2:Add, Edit, w300 ys vSelTitle
  38. Gui 2:Add, Edit, w300 vSelPath
  39. Gui 2:Add, Button, w25 gFileSelect vFileSelect r0.9 xp+300 yp, ....
  40. Gui 2:Add, Button, w100 gSelOk r1.5 xp-250 yp+35 default, OK
  41.  
  42. return
  43.  
  44.   tpp:= % "Path" %A_GuiControl%
  45.   Run % %tpp%
  46. return
  47.  
  48.   Gui +Disabled
  49.   cIndex:=%A_GuiControl%
  50.   GuiControl, 2:, SelTitle, % Title%cIndex%
  51.   GuiControl, 2:, SelPath, % Path%cIndex%
  52.   FileSelect:=cIndex
  53.   Gui 2:Show, , Select options for button ?%cIndex%
  54. return
  55.  
  56. FileSelect:
  57.  Gui +OwnDialogs
  58.   FileSelectFile, Path%cIndex%, 3, %A_ProgramFiles%, Select program to run with button ?%cIndex%, Programs(*.exe;*.lnk;*.bat)
  59.   GuiControl, 2:, SelPath, % Path%cIndex%
  60. return
  61.  
  62.  
  63. 2GuiClose:
  64.  Gui 1:-Disabled
  65.   Gui 2:Cancel
  66. return
  67.  
  68. SelOk:
  69.  Gui 1:-Disabled
  70.   Gui 2:Submit
  71.   Path%cIndex%:=SelPath
  72.   Title%cIndex%:=SelTitle
  73.   GuiControl, 1:, Butt%cIndex%, % Title%cIndex%
  74.   IniWrite, % Title%cIndex%, launcher.ini, Titles, Title%cIndex%
  75.   IniWrite, % Path%cIndex%, launcher.ini, Paths, Path%cIndex%
  76. return

« Last Edit: June 10, 2012, 05:09 PM by Contro »