Jump to content

idea for a guitar neck ui to remember notes.


sumit
 Share

Recommended Posts

You will still need two strings to be highlighted at once.

My first thought for having the previous notes still hilighted (perhaps even to indicate a slide, would be to have each radio a control in its own right.

Thanks for helping out JohnOne

Link to comment
Share on other sites

It's a pleasure. I hope you keep us informed of your progress. There are a few guitarists on the forum, including admin and AutoIt creator Jon. :)

thats great .

here is the final code.

i tried a lot but at the end had to create 150 cases :)

Also change the look a bit.

have a look

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
Local $radio1, $radio2, $msg
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)


Local $iLeft = 10, $iTop = 6, $aCTRLCheckBox[150] = _
["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid

$aCTRLCheckBox[$i] = GUICtrlCreateCheckbox($aCTRLCheckBox[$i], $iLeft, $iTop, 40, 20, $BS_PUSHLIKE)
If Mod($i + 1, 25) <> 0 Then
$iLeft += 52
Else
$iLeft = 10
$iTop += 23
EndIf
Next


GUISetState() ; will display an dialog box

Local $msg
Local $r
Local $myarr[4]


; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select


Case $msg = $aCTRLCheckBox[0]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[1]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[2]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[3]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[4]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[5]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[6]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[7]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[8]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[9]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[10]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[11]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[12]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[13]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[14]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[15]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[16]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[17]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[18]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[19]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[20]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[21]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[22]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[23]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[24]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[25]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[26]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[27]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[28]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[29]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[30]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[31]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[32]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[33]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[34]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[35]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[36]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[37]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[38]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[39]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[40]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[41]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[42]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[43]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[44]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[45]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[46]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[47]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[48]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[49]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[50]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[51]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[52]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[53]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[54]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[55]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[56]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[57]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[58]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[59]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[60]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[61]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[62]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[63]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[64]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[65]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[66]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[67]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[68]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[69]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[70]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[71]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[72]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[73]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[74]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[75]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[76]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[77]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[78]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[79]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[80]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[81]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[82]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[83]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[84]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[85]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[86]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[87]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[88]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[89]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[90]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[91]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[92]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[93]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[94]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[95]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[96]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[97]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[98]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[99]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[100]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[101]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[102]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[103]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[104]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[105]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[106]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[107]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[108]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[109]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[110]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[111]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[112]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[113]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[114]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[115]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[116]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[117]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[118]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[119]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[120]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[121]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[122]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[123]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[124]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[125]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[126]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[127]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[128]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[129]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[130]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[131]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[132]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[133]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[134]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[135]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[136]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[137]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[138]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[139]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[140]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[141]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[142]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[143]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[144]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[145]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[146]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[147]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[148]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
Case $msg = $aCTRLCheckBox[149]
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)



Case $msg = $GUI_EVENT_CLOSE
ExitLoop



EndSelect

WEnd
EndFunc ;==>Example
Link to comment
Share on other sites

sumit

Simplified :sweating::idiot:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
    Local $radio1, $radio2, $msg
    GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

    Local $iLeft = 10, $iTop = 6, $aCTRLCheckBox[150] = _
            ["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

    For $i = 0 To 149 ; Look at this code for laying out controls in a grid

        $aCTRLCheckBox[$i] = GUICtrlCreateCheckbox($aCTRLCheckBox[$i], $iLeft, $iTop, 40, 20, $BS_PUSHLIKE)
        If Mod($i + 1, 25) <> 0 Then
            $iLeft += 52
        Else
            $iLeft = 10
            $iTop += 23
        EndIf
    Next

    GUISetState() ; will display an dialog box

    Local $msg
    Local $r
    Local $myarr[4]

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $aCTRLCheckBox[0] To $aCTRLCheckBox[149]
                $j = $msg - $aCTRLCheckBox[0] + 1
                $myarr[3] = $myarr[2]
                $myarr[2] = $myarr[1]
                $myarr[1] = $myarr[0]
                $myarr[0] = $msg
                GUICtrlSetState($myarr[3], $GUI_UNCHECKED)

            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example
Edited by AZJIO
Link to comment
Share on other sites

Simplified (though some of the variables are mislabled...still works :) ):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)
Dim $tempArray[6]=['e','B','G','D','A','E']
$iDimOne_Counter = 0
Local $aCTRLCheckBox[6][24]
$iChangeLeft = 23
$iChangeTop = 52

$iLeft = 6
For $i = 0 To UBound ($aCTRLCheckBox) - 1
$iDimTwo_Counter = 0
$iTop = 10
For $j = 0 To UBound ($aCTRLCheckBox, 2 ) - 1
$aCTRLCheckBox[$i][$j] = GUICtrlCreateCheckbox($iDimTwo_Counter & $tempArray[$iDimOne_Counter], $iTop, $iLeft, 40, 20, $BS_PUSHLIKE)
$iDimTwo_Counter+=1
$iTop += $iChangeTop
Next
$iDimOne_Counter+=1
$iLeft += $iChangeLeft
Next
GUISetState() ; will display an dialog box
Local $msg
Local $r
Local $myarr[4]
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg > 0 Then
For $i = 0 To UBound($aCTRLCheckBox)-1
For $j = 0 To UBound($aCTRLCheckBox,2)-1
    If $msg = $aCTRLCheckBox[$i][$j] Then
     $myarr[3] = $myarr[2]
     $myarr[2] = $myarr[1]
     $myarr[1] = $myarr[0]
     $myarr[0] = $msg
     GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
     ExitLoop 2
    EndIf
Next
Next
EndIf
WEnd

the dual loop isn't necessary either:

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
;~ If $msg > 0 Then
;~ For $i = 0 To UBound($aCTRLCheckBox)-1
;~ For $j = 0 To UBound($aCTRLCheckBox,2)-1
;~  If $msg = $aCTRLCheckBox[$i][$j] Then
;~   $myarr[3] = $myarr[2]
;~   $myarr[2] = $myarr[1]
;~   $myarr[1] = $myarr[0]
;~   $myarr[0] = $msg
;~   GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
;~   ExitLoop 2
;~  EndIf
;~ Next
;~ Next
;~ EndIf
If $msg >= $aCTRLCheckBox[0][0] And $msg <= $aCTRLCheckBox[UBound($aCTRLCheckBox)-1][UBound($aCTRLCheckBox,2)-1] Then
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
EndIf
WEnd
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

An example of how to create items in a table

http://pastebin.com/cBna5Sv3

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

$hGui = GUICreate('My Program', 1270, 146)
GUICtrlCreateGroup("", 88, 20, 233, 273)

$iCount = 150 ; Количество пунктов
$iRows = 6 ; Количество строк
Global $BoxConfig[$iCount + 1] = [$iCount], $a[10] = [0, 0, $iRows, 11, 11, 20, 49, -1, 1]
; a[0] - X-координата элемента
; a[1] - Y-координата элемента
; a[2] - Количество строк в блоке
; a[3] - X-координата блока
; a[4] - Y-координата блока
; a[5] - Вертикальный шаг в блоке
; a[6] - Горизонтальный шаг в блоке
; a[7] - Индекс текущей колонки
; a[8] - Индекс пункта следующей колонки
$c = 0
For $i = 1 To $iCount
    If $i = $a[8] Then
        $a[8] += $a[2]
        $a[7] += 1
        $c = 0
    EndIf
    $c += 1
    $a[0] = $a[7] * $a[6] + $a[3] ; X
    $a[1] = $a[4] + Mod($i - 1, $a[2]) * $a[5] ; Y
    $BoxConfig[$i] = GUICtrlCreateCheckbox($a[7] & ' ' & Chr(64 + $c), $a[0], $a[1], 49, 20, $BS_PUSHLIKE)
Next
$a = 0
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()

Local $nMsg
Local $myarr[4]
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $BoxConfig[1] To $BoxConfig[$BoxConfig[0]]
            ; $j = $nMsg - $BoxConfig[1] + 1
            ; MsgBox(0, 'Check', $j, 0, $hGui)
            $myarr[3] = $myarr[2]
            $myarr[2] = $myarr[1]
            $myarr[1] = $myarr[0]
            $myarr[0] = $nMsg
            GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
        Case -3
            Exit
    EndSwitch
WEnd
Edited by AZJIO
Link to comment
Share on other sites

It's getting better every time. The only thing is I find it hard to see where I am with so many frets. Perhaps you could do something to make frets 0, 5, 7, 12, 17, 19 and 24 stand out. Perhaps some colour. Many guitars have white dots on the side of the fretboard at these positions (it depends how many frets are available).

Link to comment
Share on other sites

sumit

Simplified :sweating::idiot:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ButtonConstants.au3>

Example()

Func Example()
    Local $radio1, $radio2, $msg
    GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

    Local $iLeft = 10, $iTop = 6, $aCTRLCheckBox[150] = _
            ["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

    For $i = 0 To 149 ; Look at this code for laying out controls in a grid

        $aCTRLCheckBox[$i] = GUICtrlCreateCheckbox($aCTRLCheckBox[$i], $iLeft, $iTop, 40, 20, $BS_PUSHLIKE)
        If Mod($i + 1, 25) <> 0 Then
            $iLeft += 52
        Else
            $iLeft = 10
            $iTop += 23
        EndIf
    Next

    GUISetState() ; will display an dialog box

    Local $msg
    Local $r
    Local $myarr[4]

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $aCTRLCheckBox[0] To $aCTRLCheckBox[149]
                $j = $msg - $aCTRLCheckBox[0] + 1
                $myarr[3] = $myarr[2]
                $myarr[2] = $myarr[1]
                $myarr[1] = $myarr[0]
                $myarr[0] = $msg
                GUICtrlSetState($myarr[3], $GUI_UNCHECKED)

            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc ;==>Example

thanks AZJIO exactly what i wanted to do but could not :)
Link to comment
Share on other sites

Simplified (though some of the variables are mislabled...still works :) ):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)
Dim $tempArray[6]=['e','B','G','D','A','E']
$iDimOne_Counter = 0
Local $aCTRLCheckBox[6][24]
$iChangeLeft = 23
$iChangeTop = 52

$iLeft = 6
For $i = 0 To UBound ($aCTRLCheckBox) - 1
$iDimTwo_Counter = 0
$iTop = 10
For $j = 0 To UBound ($aCTRLCheckBox, 2 ) - 1
$aCTRLCheckBox[$i][$j] = GUICtrlCreateCheckbox($iDimTwo_Counter & $tempArray[$iDimOne_Counter], $iTop, $iLeft, 40, 20, $BS_PUSHLIKE)
$iDimTwo_Counter+=1
$iTop += $iChangeTop
Next
$iDimOne_Counter+=1
$iLeft += $iChangeLeft
Next
GUISetState() ; will display an dialog box
Local $msg
Local $r
Local $myarr[4]
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg > 0 Then
For $i = 0 To UBound($aCTRLCheckBox)-1
For $j = 0 To UBound($aCTRLCheckBox,2)-1
    If $msg = $aCTRLCheckBox[$i][$j] Then
     $myarr[3] = $myarr[2]
     $myarr[2] = $myarr[1]
     $myarr[1] = $myarr[0]
     $myarr[0] = $msg
     GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
     ExitLoop 2
    EndIf
Next
Next
EndIf
WEnd

the dual loop isn't necessary either:

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
;~ If $msg > 0 Then
;~ For $i = 0 To UBound($aCTRLCheckBox)-1
;~ For $j = 0 To UBound($aCTRLCheckBox,2)-1
;~  If $msg = $aCTRLCheckBox[$i][$j] Then
;~   $myarr[3] = $myarr[2]
;~   $myarr[2] = $myarr[1]
;~   $myarr[1] = $myarr[0]
;~   $myarr[0] = $msg
;~   GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
;~   ExitLoop 2
;~  EndIf
;~ Next
;~ Next
;~ EndIf
If $msg >= $aCTRLCheckBox[0][0] And $msg <= $aCTRLCheckBox[UBound($aCTRLCheckBox)-1][UBound($aCTRLCheckBox,2)-1] Then
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetState($myarr[3], $GUI_UNCHECKED)
EndIf
WEnd

thanks for the help jdelaney'
Link to comment
Share on other sites

It's getting better every time. The only thing is I find it hard to see where I am with so many frets. Perhaps you could do something to make frets 0, 5, 7, 12, 17, 19 and 24 stand out. Perhaps some colour. Many guitars have white dots on the side of the fretboard at these positions (it depends how many frets are available).

i just tried changing text color of frets 0, 5, 7, 12, 17, 19. using GUICtrlSetColor ( controlID, textcolor ) . No success yet.

Link to comment
Share on other sites

Indeed, it seems not to work with CheckBoxes. I have changed it to buttons. See what you think. Not all the coloured frets are finished. You need to add a few more numbers. It's clear enough. Perhaps you prefer not to use buttons, but it's almost the same effect as you had before.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3>
;#include <ButtonConstants.au3>

Example()

Func Example()
    Local $radio1, $radio2, $msg
    GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

    Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
            ["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

    For $i = 0 To 149 ; Look at this code for laying out controls in a grid
        $aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
        GUICtrlSetBkColor($aFretButton[$i], 0xF5F5F5)
        Switch $i
            Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
                GUICtrlSetColor($aFretButton[$i], 0xFF0000)
            Case 5, 7, 17, 19 ; THIS IS UNFINISHED
                GUICtrlSetColor($aFretButton[$i], 0x0000FF)
        EndSwitch


        If Mod($i + 1, 25) <> 0 Then
            $iLeft += 52
        Else
            $iLeft = 10
            $iTop += 23
        EndIf
    Next

    GUISetState() ; will display the GUI

    Local $msg
    Local $r
    Local $myarr[4]

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $aFretButton[0] To $aFretButton[149]
                $j = $msg - $aFretButton[0] + 1
                $myarr[3] = $myarr[2]
                $myarr[2] = $myarr[1]
                $myarr[1] = $myarr[0]
                $myarr[0] = $msg
                GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
                GUICtrlSetBkColor($myarr[0], 0xFFFFFF) ; Give a bit more highlight
                GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
                GUICtrlSetBkColor($myarr[3], 0xF5F5F5)

            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

If you wanted, you can use labels with images or graphic controls using a similar method to the above. Also here's another grid of buttons I used for That script uses a 2D array.

Edited by czardas
Link to comment
Share on other sites

Indeed, it seems not to work with CheckBoxes. I have changed it to buttons. See what you think. Not all the coloured frets are finished. You need to add a few more numbers. It's clear enough. Perhaps you prefer not to use buttons, but it's almost the same effect as you had before.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3>
;#include <ButtonConstants.au3>

Example()

Func Example()
Local $radio1, $radio2, $msg
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
         ["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid
     $aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
GUICtrlSetBkColor($aFretButton[$i], 0xF5F5F5)
Switch $i
Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
GUICtrlSetColor($aFretButton[$i], 0xFF0000)
Case 5, 7, 17, 19 ; THIS IS UNFINISHED
GUICtrlSetColor($aFretButton[$i], 0x0000FF)
EndSwitch


     If Mod($i + 1, 25) <> 0 Then
         $iLeft += 52
     Else
         $iLeft = 10
         $iTop += 23
     EndIf
Next

GUISetState() ; will display the GUI

Local $msg
Local $r
Local $myarr[4]

; Run the GUI until the dialog is closed
While 1
     $msg = GUIGetMsg()
     Switch $msg
         Case $aFretButton[0] To $aFretButton[149]
             $j = $msg - $aFretButton[0] + 1
             $myarr[3] = $myarr[2]
             $myarr[2] = $myarr[1]
             $myarr[1] = $myarr[0]
             $myarr[0] = $msg
GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($myarr[0], 0xFFFFFF) ; Give a bit more highlight
GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor($myarr[3], 0xF5F5F5)

         Case $GUI_EVENT_CLOSE
             ExitLoop
     EndSwitch
WEnd
EndFunc ;==>Example

If you wanted, you can use labels with images or graphic controls using a similar method to the above. Also here's another grid of buttons I used for That script uses a 2D array.

wow it looks great

I'm not sure how the effect of 3d is being done in virtual keyboard .

check out this version

#include
#include
;#include
;#include

Example()

Func Example()
Local $radio1, $radio2, $msg
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid
$aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
GUICtrlSetBkColor($aFretButton[$i], 0xCDC9C9)
Switch $i
Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
GUICtrlSetColor($aFretButton[$i], 0xFF0000)
Case 3, 5, 7, 9, 15, 17, 19, 21, 28, 30, 32, 34, 40, 42, 44, 46, 53, 55, 57, 59, 65, 67, 69, 71, 78, 80, 82, 84, 90, 92, 94, 96, 103, 105, 107, 109, 115, 117, 119, 121, 128, 130, 132, 134, 140, 142, 144, 146 ; THIS IS UNFINISHED
GUICtrlSetColor($aFretButton[$i], 0x0000FF)
EndSwitch


If Mod($i + 1, 25) <> 0 Then
$iLeft += 52
Else
$iLeft = 10
$iTop += 23
EndIf
Next

GUISetState() ; will display the GUI

Local $msg
Local $r
Local $myarr[4]

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Switch $msg
Case $aFretButton[0] To $aFretButton[149]
$j = $msg - $aFretButton[0] + 1
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($myarr[0], 0x9ACD32) ; Give a bit more highlight
GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor($myarr[3], 0xCDC9C9)


Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
EndFunc ;==>Example
Edited by sumit
Link to comment
Share on other sites

Woah. what an improvement. :) Somehow your code is getting slightly messed up by the forum software. Instead of pasting your code directly into the forum popup window, try first adding the autoit tags to your post and then paste the code between them. This always works for me.

If you mean 3D effects on the buttons, that is done by setting the extended control style to $WS_EX_CLIENTEDGE. There's only one small detail you might want to figure out. When you click on the same button three times in a row it still resets the previous buttons until there are no buttons highlighted anymore. This constitutes a bug, but I'm sure you can think of something to stop that from happening.

Edited by czardas
Link to comment
Share on other sites

I fixed it for you anyway. Make sure you know what the code is doing. Also try to think ahead to the next stage when you make a design choice.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3> ; No longer needed
;#include <ButtonConstants.au3> ; No longer needed

Example()

Func Example()
    Local $msg
    GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

    Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
    ["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

    For $i = 0 To 149 ; Look at this code for laying out controls in a grid
        $aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
        GUICtrlSetBkColor($aFretButton[$i], 0xCDC9C9)
        Switch $i
            Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
                GUICtrlSetColor($aFretButton[$i], 0xFF0000)
            Case 3, 5, 7, 9, 15, 17, 19, 21, 28, 30, 32, 34, 40, 42, 44, 46, 53, 55, 57, 59, 65, 67, 69, 71, 78, 80, 82, 84, 90, 92, 94, 96, 103, 105, 107, 109, 115, 117, 119, 121, 128, 130, 132, 134, 140, 142, 144, 146 ; THIS IS UNFINISHED
                GUICtrlSetColor($aFretButton[$i], 0x0000FF)
        EndSwitch

        If Mod($i + 1, 25) <> 0 Then
            $iLeft += 52
        Else
            $iLeft = 10
            $iTop += 23
        EndIf
    Next

    GUISetState() ; will display the GUI

    Local $msg
    Local $j
    Local $myarr[4]

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()
        If $msg <> $myarr[0] And $msg <> $myarr[1] And $msg <> $myarr[2] Then ; Check the button isn't highlighted already
            Switch $msg
                Case $aFretButton[0] To $aFretButton[149]
                    $j = $msg - $aFretButton[0] + 1
                    $myarr[3] = $myarr[2]
                    $myarr[2] = $myarr[1]
                    $myarr[1] = $myarr[0]
                    $myarr[0] = $msg
                    GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
                    GUICtrlSetBkColor($myarr[0], 0x9ACD32) ; Give a bit more highlight
                    GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
                    GUICtrlSetBkColor($myarr[3], 0xCDC9C9)

                Case $GUI_EVENT_CLOSE
                    ExitLoop
            EndSwitch
        EndIf
    WEnd
EndFunc ;==>Example
Link to comment
Share on other sites

I fixed it for you anyway. Make sure you know what the code is doing. Also try to think ahead to the next stage when you make a design choice.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3> ; No longer needed
;#include <ButtonConstants.au3> ; No longer needed

Example()

Func Example()
Local $msg
GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)

Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid
$aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
GUICtrlSetBkColor($aFretButton[$i], 0xCDC9C9)
Switch $i
Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
GUICtrlSetColor($aFretButton[$i], 0xFF0000)
Case 3, 5, 7, 9, 15, 17, 19, 21, 28, 30, 32, 34, 40, 42, 44, 46, 53, 55, 57, 59, 65, 67, 69, 71, 78, 80, 82, 84, 90, 92, 94, 96, 103, 105, 107, 109, 115, 117, 119, 121, 128, 130, 132, 134, 140, 142, 144, 146 ; THIS IS UNFINISHED
GUICtrlSetColor($aFretButton[$i], 0x0000FF)
EndSwitch

If Mod($i + 1, 25) <> 0 Then
$iLeft += 52
Else
$iLeft = 10
$iTop += 23
EndIf
Next

GUISetState() ; will display the GUI

Local $msg
Local $j
Local $myarr[4]

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg <> $myarr[0] And $msg <> $myarr[1] And $msg <> $myarr[2] Then ; Check the button isn't highlighted already
Switch $msg
Case $aFretButton[0] To $aFretButton[149]
$j = $msg - $aFretButton[0] + 1
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($myarr[0], 0x9ACD32) ; Give a bit more highlight
GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor($myarr[3], 0xCDC9C9)

Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
EndIf
WEnd
EndFunc ;==>Example

looks awesome

thanks for helping out

czardas

Link to comment
Share on other sites

Wooden Fretboard look :)

Note - the code requies the attached image to be put in images forlder of autoit install directory

( InstallDir "\Examples\GUI\Advanced\Images" )

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3> ; No longer needed
;#include <ButtonConstants.au3> ; No longer needed

Example()

Func Example()
Local $msg

Local $btn, $chk, $rdo, $msg
Local $Wow64 = ""
If @AutoItX64 Then $Wow64 = "\Wow6432Node"
Local $sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Advanced\Images"



GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default)
GUICtrlCreatePic($sPath & "\images.bmp", 0, 0, 1302, 146)
GUICtrlSetState(-1, $GUI_DISABLE)
Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid
$aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
GUICtrlSetBkColor($aFretButton[$i], 0xCDAA7D)
Switch $i
Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
GUICtrlSetColor($aFretButton[$i], 0xFF0000)
Case 3, 5, 7, 9, 15, 17, 19, 21, 28, 30, 32, 34, 40, 42, 44, 46, 53, 55, 57, 59, 65, 67, 69, 71, 78, 80, 82, 84, 90, 92, 94, 96, 103, 105, 107, 109, 115, 117, 119, 121, 128, 130, 132, 134, 140, 142, 144, 146 ; THIS IS UNFINISHED
GUICtrlSetColor($aFretButton[$i], 0x0000FF)
EndSwitch

If Mod($i + 1, 25) <> 0 Then
$iLeft += 52
Else
$iLeft = 10
$iTop += 23
EndIf
Next

GUISetState() ; will display the GUI

Local $msg
Local $j
Local $myarr[4]

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg <> $myarr[0] And $msg <> $myarr[1] And $msg <> $myarr[2] Then ; Check the button isn't highlighted already
Switch $msg
Case $aFretButton[0] To $aFretButton[149]
$j = $msg - $aFretButton[0] + 1
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
;GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($myarr[0], 0x66CD00) ; Give a bit more highlight
GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor($myarr[3], 0xCDAA7D)

Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
EndIf
WEnd
EndFunc ;==>Example

images.bmp

Link to comment
Share on other sites

Add style to gui

GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default,$WS_POPUP)

Add hotkey exit func

HotKeySet("{ESC}","_Exit")

Func _Exit()

Exit

EndFunc

thanks JohnOne :)

here's the modified code after this.

Note - requires image attachement to be downloaded in images folder of Auto it install directory

("InstallDir"\Examples\GUI\Advanced\Images")

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;#include <Array.au3> ; No longer needed
;#include <ButtonConstants.au3> ; No longer needed

Example()


HotKeySet("{ESC}","_Exit")
Func _Exit()
Exit
EndFunc
Func Example()
Local $msg

Local $btn, $chk, $rdo, $msg
Local $Wow64 = ""
If @AutoItX64 Then $Wow64 = "\Wow6432Node"
Local $sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\Advanced\Images"



GUICreate("Guitar Notes Memorizer", 1302, 146, Default, Default,$WS_POPUP)
GUICtrlCreatePic($sPath & "\images.bmp", 0, 0, 1302, 146)
GUICtrlSetState(-1, $GUI_DISABLE)
Local $iLeft = 10, $iTop = 6, $aFretButton[150] = _
["0e", "1e", "2e", "3e", "4e", "5e", "6e", "7e", "8e", "9e", "10e", "11e", "12e", "13e", "14e", "15e", "16e", "17e", "18e", "19e", "20e", "21e", "22e", "23e", "24e", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "10B", "11B", "12B", "13B", "14B", "15B", "16B", "17B", "18B", "19B", "20B", "21B", "22B", "23B", "24B", "0G", "1G", "2G", "3G", "4G", "5G", "6G", "7G", "8G", "9G", "10G", "11G", "12G", "13G", "14G", "15G", "16G", "17G", "18G", "19G", "20G", "21G", "22G", "23G", "24G", "0D", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "11D", "12D", "13D", "14D", "15D", "16D", "17D", "18D", "19D", "20D", "21D", "22D", "23D", "24D", "0A", "1A", "2A", "3A", "4A", "5A", "6A", "7A", "8A", "9A", "10A", "11A", "12A", "13A", "14A", "15A", "16A", "17A", "18A", "19A", "20A", "21A", "22A", "23A", "24A", "0E", "1E", "2E", "3E", "4E", "5E", "6E", "7E", "8E", "9E", "10E", "11E", "12E", "13E", "14E", "15E", "16E", "17E", "18E", "19E", "20E", "21E", "22E", "23E", "24E"]

For $i = 0 To 149 ; Look at this code for laying out controls in a grid
$aFretButton[$i] = GUICtrlCreateButton($aFretButton[$i], $iLeft, $iTop, 40, 20)
GUICtrlSetBkColor($aFretButton[$i], 0xCDAA7D)
Switch $i
Case 0, 12, 24, 25, 37, 49, 50, 62, 74, 75, 87, 99, 100, 112, 124, 125, 137, 149
GUICtrlSetColor($aFretButton[$i], 0xFF0000)
Case 3, 5, 7, 9, 15, 17, 19, 21, 28, 30, 32, 34, 40, 42, 44, 46, 53, 55, 57, 59, 65, 67, 69, 71, 78, 80, 82, 84, 90, 92, 94, 96, 103, 105, 107, 109, 115, 117, 119, 121, 128, 130, 132, 134, 140, 142, 144, 146 ; THIS IS UNFINISHED
GUICtrlSetColor($aFretButton[$i], 0x0000FF)
EndSwitch

If Mod($i + 1, 25) <> 0 Then
$iLeft += 52
Else
$iLeft = 10
$iTop += 23
EndIf
Next

GUISetState() ; will display the GUI

Local $msg
Local $j
Local $myarr[4]

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg <> $myarr[0] And $msg <> $myarr[1] And $msg <> $myarr[2] Then ; Check the button isn't highlighted already
Switch $msg
Case $aFretButton[0] To $aFretButton[149]
$j = $msg - $aFretButton[0] + 1
$myarr[3] = $myarr[2]
$myarr[2] = $myarr[1]
$myarr[1] = $myarr[0]
$myarr[0] = $msg
;GUICtrlSetStyle($myarr[0], Default, $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor($myarr[0], 0x66CD00) ; Give a bit more highlight
GUICtrlSetStyle($myarr[3], Default, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor($myarr[3], 0xCDAA7D)

Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
EndIf
WEnd
EndFunc ;==>Example

images.bmp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...