AutoHotkey Community

It is currently May 25th, 2012, 9:18 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 172 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject:
PostPosted: September 6th, 2007, 10:15 am 
Offline

Joined: January 20th, 2007, 1:29 pm
Posts: 96
Location: Melbourne
heres what im working on at the moment, a Frontend that will eventually play DJ and Karaoke using Plugins for as many karaoke players that i can lay my hands on. it has some stuff working like Numpad del key and then immediately any numpad number from 0-9 for sound effects etc.... and some setup code and my version of tooltip without the tip...
what was happening was i was resizing windows and then switching between kj and dj mode and it lost all the positions but not the size after resizing.

you will see my code remedy in the hidekaraoke and hidedj routines.

Code:
#Include Anchor.ahk
;----------------------------------------------------------
; @@@@@@                         @                    @@@  ;
; @@                            @@                     @@  ;
; @@     @@ @@@   @@@@  @@@@@  @@@@@  @@@@  @@@@@      @@  ;
; @@@@    @@@ @@ @@  @@ @@  @@  @@   @@  @@ @@  @@  @@@@@  ;
; @@      @@  @@ @@  @@ @@  @@  @@   @@@@@@ @@  @@ @@  @@  ;
; @@      @@     @@  @@ @@  @@  @@ @ @@     @@  @@ @@  @@  ;
; @@     @@@@     @@@@  @@  @@   @@   @@@@  @@  @@  @@@ @@ ;
;----------------------------------------------------------;
;tag
;Frontend:
; Language:       English
; Platform:       Win9x/NT
; Author:         T. Gowshall <trubbleguy@optusnet.com.au>

/*
********** Settings, Variable Declarations **********
*/

#SingleInstance Force
#NoEnv
SendMode Input
programName = Universal Karaoke Frontend ; DEBUG: to do
programVersion = V2.001 ; DEBUG: to do
programFullName = %programName% %programVersion%
programAuthor = Trubbleguy ; DEBUG: to do
Guinum=8
#Persistent
windows=3%A_Tab%gui3,4%A_Tab%gui4,5%A_Tab%gui5,6%A_Tab%gui6,7%A_Tab%gui7,8%A_Tab%gui8
SetTimer Caps, 1000
SetTitleMatchMode,3
_ini=%A_ScriptDir%\settings.ini
StringCaseSense,Off
_activemode=karaoke
;-------------------------------------------------------------------------------------------------
;  @@@@           @       @@@@                                                  @@                ;
; @@  @@         @@      @@  @@                                                                   ;
;@@       @@@@  @@@@@    @@@     @@@@   @@ @@@   @@@@   @@@@  @@@@@      @@@@@ @@@  @@@@@@  @@@@  ;
;@@      @@  @@  @@       @@@   @@  @@   @@@ @@ @@  @@ @@  @@ @@  @@    @@      @@  @  @@  @@  @@ ;
;@@  @@@ @@@@@@  @@         @@@ @@       @@  @@ @@@@@@ @@@@@@ @@  @@     @@@@   @@    @@   @@@@@@ ;
; @@  @@ @@      @@ @    @@  @@ @@  @@   @@     @@     @@     @@  @@        @@  @@   @@  @ @@     ;
;  @@@@@  @@@@    @@      @@@@   @@@@   @@@@     @@@@   @@@@  @@  @@    @@@@@  @@@@ @@@@@@  @@@@  ;
;-------------------------------------------------------------------------------------------------;
;tag
;Screensize:
SysGet, MWA, MonitorWorkArea,1
_swidth:=MWARight-20
_mid := MWABottom /2
_splashbot := MWABottom - 37
_x:=(A_ScreenWidth-789)/2
_y:=(A_ScreenHeight-521)/2
_swidth:=(_swidth/2)+65

Gosub readini
vkey=`n%programFullName%`nBy %programAuthor%
GoSub, getParams
GoSub, trayMenu
Gosub buttoninfo

;-------------------------------
;  @@@@           @@       @@   ;
; @@  @@                  @@@   ;
;@@      @@  @@  @@@       @@   ;
;@@      @@  @@   @@       @@   ;
;@@  @@@ @@  @@   @@       @@   ;
; @@  @@ @@  @@   @@       @@   ;
;  @@@@@  @@@ @@ @@@@    @@@@@@ ;
;-------------------------------;
;tag
Gui1:
DllCall("QueryPerformanceFrequency", "Int64P", freq)
If Resized=1
Vkey=Resize and Move Complete
Gui, 1:Add, Edit, vedit1 x330 y80 R2 w260,
Gui, 1:Add, Button,vf1 x10 y2 w50 h20 gtogglemode,F1
Gui, 1:Add, Button,vf2 xp+52 yp wp hp,F2
Gui, 1:Add, Button,vf3 xp+52 yp wp hp,F3
Gui, 1:Add, Button,vf4 xp+52 yp wp hp,F4
Gui, 1:Add, Button,vf5 xp+52 yp wp hp,F5
Gui, 1:Add, Button,vf6 xp+52 yp wp hp,F6
Gui, 1:Add, Button,vf7 xp+55 yp wp hp,F7
Gui, 1:Add, Button,vf8 xp+54 yp wp hp,F8
Gui, 1:Add, Button,vf9 xp+54 yp wp hp,F9
Gui, 1:Add, Button,vf10 xp+54 yp wp hp,F10
Gui, 1:Add, Button,vf11 xp+54 yp wp hp,F11
Gui, 1:Add, Button,vf12 xp+54 yp wp hp,F12
Gui, 1:Add, Button,vsearch x10 y24 w50 h23 gsearch,Search
Gui, 1:Add, Button,vplayit xp+52 yp wp hp,Playit
Gui, 1:Add, Button,vopen xp+52 yp wp hp,Open
Gui, 1:Add, Button,vstop xp+52 yp wp hp,Stop
Gui, 1:Add, Button,vplay xp+52 yp wp hp,Play
Gui, 1:Add, Button,vsfx xp+52 yp wp hp gsfxapplause,SFX
Gui, 1:Add, Edit,vedit x10 y50 l1 w154,
Gui, 1:Add, Button,vfavorite x166 y50 w50 h23,Favorite
Gui, 1:Add, Button,vrescan xp+52 yp wp hp,ReScan
Gui, 1:Add, Button,vbutton xp+52 yp wp hp,Button
Gui, 1:Add, Button,vsetup x596 y29 w50 h23 Center gsetup,Setup
Gui, 1:Add, Button,vexit xp yp+29 wp hp Center gExit,EXIT

;------------------------------------------------------------
;  @@@@           @@      @@@@           @                   ;
; @@  @@                 @@  @@         @@                   ;
;@@      @@  @@  @@@     @@@     @@@@  @@@@@ @@  @@  @@ @@@  ;
;@@      @@  @@   @@      @@@   @@  @@  @@   @@  @@   @@  @@ ;
;@@  @@@ @@  @@   @@        @@@ @@@@@@  @@   @@  @@   @@  @@ ;
; @@  @@ @@  @@   @@     @@  @@ @@      @@ @ @@  @@   @@@@@  ;
;  @@@@@  @@@ @@ @@@@     @@@@   @@@@    @@   @@@ @@  @@     ;
;----------------------------------------------------@@@-----;
;tag
Gui2:
Gui, 2:Add, Button, x500 y300 w130 h30 Center gclosesetup,Save and Exit
Gui, 2:Add, Button, x20 y20 w120 h20 Center ,Set Database file
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set Database folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set Karaoke folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set Dj Folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set Player Plugin
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set Winrar folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set some other folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set some other folder
Gui, 2:Add, Button, xp yp+25 wp hp Center ,Set some other folder
Gui, 2:Add, Text,x160 y25 w350 h20,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, Text,xp yp+25 wp hp,this is a huge text to display in the middle of the damn setup box
Gui, 2:Add, CheckBox, x500 y20 w150 h30,Winrar Used
Gui, 2:Add, CheckBox, xp yp+25 wp hp,Database Used
Gui, 2:Add, CheckBox, xp yp+25 wp hp,Dj Mode Used
Gui, 2:Add, CheckBox, xp yp+25 wp hp,Favorites used
Gui, 2:Add, CheckBox, xp yp+25 wp hp,Rotatation Used
Gui, 2:Add, CheckBox, xp yp+25 wp hp,Dj Playlist Used
Gui, 2:Add, CheckBox, xp yp+30 wp hp gTooltiponoff Checked%_tt%,Visual Help Enable`n(Mouse Over Controls)
Gui, 2:Add, CheckBox, xp yp+30 wp hp ghidemode1 Checked%_hm%,Hide Unused Mode`n(Less Screen Used.)
;-------------------------------
;  @@@@           @@      @@@@  ;
; @@  @@                 @@  @@ ;
;@@      @@  @@  @@@         @@ ;
;@@      @@  @@   @@       @@@  ;
;@@  @@@ @@  @@   @@         @@ ;
; @@  @@ @@  @@   @@     @@  @@ ;
;  @@@@@  @@@ @@ @@@@     @@@@  ;
;-------------------------------;
Gui3:
gui, 3:+owner1 
Gui, 3: +Resize   
Gui, 3:Add, ListView, vlist3 %_ab3% ,3| | | |
;--------------------------------
;  @@@@           @@        @@@  ;
; @@  @@                   @@@@  ;
;@@      @@  @@  @@@      @@ @@  ;
;@@      @@  @@   @@     @@  @@  ;
;@@  @@@ @@  @@   @@     @@@@@@@ ;
; @@  @@ @@  @@   @@         @@  ;
;  @@@@@  @@@ @@ @@@@       @@@@ ;
;--------------------------------;
;tag
Gui4:
gui, 4:+owner1 
Gui, 4: +Resize   
Gui, 4:Add, ListView,vlist4 %_ab4% ,4| | | |
;-------------------------------
;  @@@@           @@     @@@@@@ ;
; @@  @@                 @@     ;
;@@      @@  @@  @@@     @@@@@  ;
;@@      @@  @@   @@         @@ ;
;@@  @@@ @@  @@   @@         @@ ;
; @@  @@ @@  @@   @@     @@  @@ ;
;  @@@@@  @@@ @@ @@@@     @@@@  ;
;-------------------------------;
Gui5:
gui, 5:+owner1 
Gui, 5: +Resize   
Gui, 5:Add, ListView,vlist5 %_ab5% ,5| | | |
;-------------------------------
;  @@@@           @@       @@@  ;
; @@  @@                  @@    ;
;@@      @@  @@  @@@     @@     ;
;@@      @@  @@   @@     @@@@@  ;
;@@  @@@ @@  @@   @@     @@  @@ ;
; @@  @@ @@  @@   @@     @@  @@ ;
;  @@@@@  @@@ @@ @@@@     @@@@  ;
;-------------------------------;
;tag
Gui6:
gui, 6:+owner1 
Gui, 6: +Resize   
Gui, 6:Add, ListView,vlist6  %_ab6%  ,6| | | |
;----------------------------
;  @@@@           @@  @@@@@@ ;
; @@  @@              @@  @@ ;
;@@      @@  @@  @@@      @@ ;
;@@      @@  @@   @@     @@  ;
;@@  @@@ @@  @@   @@    @@   ;
; @@  @@ @@  @@   @@    @@   ;
;  @@@@@  @@@ @@ @@@@   @@   ;
;----------------------------;
Gui7:
gui, 7:+owner1 
Gui, 7: +Resize   
Gui, 7:Add, ListView,vlist7 %_ab7% ,7| | | |
;----------------------------
;  @@@@           @@   @@@@  ;
; @@  @@              @@  @@ ;
;@@      @@  @@  @@@  @@  @@ ;
;@@      @@  @@   @@   @@@@  ;
;@@  @@@ @@  @@   @@  @@  @@ ;
; @@  @@ @@  @@   @@  @@  @@ ;
;  @@@@@  @@@ @@ @@@@  @@@@  ;
;----------------------------;
;tag
Gui8:
gui, 8:+owner1 
Gui, 8: +Resize   
Gui, 8:Add, ListView,vlist8 %_ab8%  ,8| | | |
;------------------------------------------------------
;  @@@@           @@      @@@@  @@@                    ;
; @@  @@                 @@  @@  @@                    ;
;@@      @@  @@  @@@     @@@     @@ @@   @@@@  @@   @@ ;
;@@      @@  @@   @@      @@@    @@@ @@ @@  @@ @@ @ @@ ;
;@@  @@@ @@  @@   @@        @@@  @@  @@ @@  @@ @@@@@@@ ;
; @@  @@ @@  @@   @@     @@  @@  @@  @@ @@  @@ @@@ @@@ ;
;  @@@@@  @@@ @@ @@@@     @@@@  @@@  @@  @@@@  @@   @@ ;
;------------------------------------------------------;
;tag
;Gui Show:
Gui, 1:Show, x%ax1% y%ay1% , Main ;h%ah1%
;WinSet, ALwaysOnTop,On,Main
WinGetPos,GX,GY,GW,GH,Main
_spx:=(GX+330)
_spy:=(GY+47)
Progress,x%_spx% Y%_spy% zh0 zy1 w264 H56 B c6 CW333333 CT000000 fs11,%vkey%,,Status
WinSet, TransColor,333333,Status
WinMove,Status,%vkey%,%_spx%,%_spy%
Gui, 3:Show, x%ax3% y%ay3% , Karaoke Search
Gui, 4:Show, x%ax4% y%ay4% , Rotation
Gui, 5:Show, x%ax5% y%ay5% , Kj Favorites
Gui, 6:Show, x%ax6% y%ay6% , Dj Search
Gui, 7:Show, x%ax7% y%ay7% , Dj Playlist
Gui, 8:Show, x%ax8% y%ay8% , Dj Favorites
Gui, 3:+Resize -MaximizeBox   
Gui, 4:+Resize -MaximizeBox
Gui, 5:+Resize -MaximizeBox
Gui, 5:+Resize -MaximizeBox
Gui, 7:+Resize -MaximizeBox
Gui, 8:+Resize -MaximizeBox
Gosub hidemode
Gosub filler
ControlFocus,Edit1,Main


;----------------------------------------------------
;@@  @@          @      @@@                          ;
;@@  @@         @@       @@                          ;
;@@  @@  @@@@  @@@@@     @@  @@  @@@@  @@  @@  @@@@@ ;
;@@@@@@ @@  @@  @@       @@ @@  @@  @@ @@  @@ @@     ;
;@@  @@ @@  @@  @@       @@@@   @@@@@@ @@  @@  @@@@  ;
;@@  @@ @@  @@  @@ @     @@ @@  @@      @@@@@     @@ ;
;@@  @@  @@@@    @@     @@@  @@  @@@@      @@ @@@@@  ;
;---------------------------------------@@@@---------;
;tag
;Hot keys:
#IfWinActive Main
F1::Gosub togglemode
#IfWinActive
`::Gosub Search
NumpadDot::gosub sfx
!ESC::
   Suspend ; exempt from suspension -- DEBUG: optional
   GoSub, quit
Return
Return
;###############################################
l2:
l3:
return
;----------------------------------
; @@@@   @@                        ;
;@@  @@                            ;
;@@@    @@@  @@@@@@  @@@@  @@ @@@  ;
; @@@    @@  @  @@  @@  @@  @@@ @@ ;
;   @@@  @@    @@   @@@@@@  @@  @@ ;
;@@  @@  @@   @@  @ @@      @@     ;
; @@@@  @@@@ @@@@@@  @@@@  @@@@    ;
;----------------------------------;
;tag
;Sizer:
sizer:
normspeed:=A_Batchlines
SetBatchLines,-1
loop %Guinum%
z%A_Index%=
loop,Parse,wind,^,%A_Space%
   {
   StringSplit,z,A_Loopfield,%A_Tab%,%A_Space%
   zgui:=z1
   Gui,%z1%:Show
;   WinActivate,%z2%
   WinGetPos,GX,GY,GW,GH,%z2%
If GX =""
MsgBox Variable not found for %z2%
   GH:=(GH-20)
   GW:=(GW-8)
   If zgui between 2 and 99
   {
   IniWrite,%GW% %GH% %z2%,%_ini%,%zgui%,gui
   IniWrite,%GX% %GY% %z2%,%_ini%,%zgui%,loc
   
   ;   WinMove,%z2%,,%GX%,%GY%
   }
   If zgui=1
   {
   IniWrite,634 75 %z2%,%_ini%,1,gui
   IniWrite,%GX% %GY% %z2%,%_ini%,1,loc
   }
   }
SetBatchLines,%normspeed%
Return
;-------------------------------------
;  @@@   @@  @@@  @@@                 ;
; @@ @@       @@   @@                 ;
; @@    @@@   @@   @@   @@@@  @@ @@@  ;
;@@@@    @@   @@   @@  @@  @@  @@@ @@ ;
; @@     @@   @@   @@  @@@@@@  @@  @@ ;
; @@     @@   @@   @@  @@      @@     ;
;@@@@   @@@@ @@@@ @@@@  @@@@  @@@@    ;
;-------------------------------------;
;tag
filler:
loop,Parse,windows,`,,%A_Space%
   {
   StringSplit,z,A_Loopfield,%A_Tab%,%A_Space%
   Gui,%z1%:Default
   Gui,Listview
   loop 20
          LV_Add("",A_Index,"got to put lots of words","or add lots of words","ansome lots more words with stuff too")
   LV_ModifyCol()
   LV_ModifyCol(1, "Integer") 
   LV_ModifyCol(1,"sort")
   }
return   
;--------------------------------------------------------------------
;@@@@@@            @     @                 @@@@          @@@         ;
; @@  @@          @@    @@                  @@          @@ @@        ;
; @@  @@ @@  @@  @@@@@ @@@@@  @@@@  @@@@@   @@  @@@@@   @@     @@@@  ;
; @@@@@  @@  @@   @@    @@   @@  @@ @@  @@  @@  @@  @@ @@@@   @@  @@ ;
; @@  @@ @@  @@   @@    @@   @@  @@ @@  @@  @@  @@  @@  @@    @@  @@ ;
; @@  @@ @@  @@   @@ @  @@ @ @@  @@ @@  @@  @@  @@  @@  @@    @@  @@ ;
;@@@@@@   @@@ @@   @@    @@   @@@@  @@  @@ @@@@ @@  @@ @@@@    @@@@  ;
;--------------------------------------------------------------------;
;tag
;ButtonInfo:
buttoninfo:
;define the tooltips for the Control here, the number 1 is for Gui1:
;If the Control has spaces in the name eg. word1 word2,
;make the variable word1word2 without spaces
;all spaces in the Controls name are removed for the variable,
Loop %Guinum% ;common buttons per gui
{
   TT_%A_Index%_A=
}
TT_1_ReScan=`nClick here to Udate your song`nDatabase with Newly added songs
TT_1_Setup=`nClick here to display Setup screen
TT_1_F1=KARAOKE / DJ Toggle`nToggles between Modes`nHides NoN Active Mode
TT_1_F2=`nRotation window
TT_1_F3=`nStart Recording`nthrough LINE IN
TT_1_F4=`nStop  Recording
TT_1_F5=`nPlay Back Recording
TT_1_F6=`nLeft Multiplex Channel
TT_1_F7=`nStereo (normal) Channel
TT_1_F8=`nRight Multiplex Channel
TT_1_F9=`nDown a Key
TT_1_F10=`nReset ALL`nKey Changes
TT_1_F11=`nUp a key
TT_1_F12=`nToggle singer screen monitor
TT_1_Search=Use Tilde key ( ~ )`nFor a new Search`nOn Whichever Mode is Active
TT_1_Stop=`nUse Numpad key`nMinus ( - )
TT_1_play=`nUse Numpad key`nPlus ( + )
TT_1_Open=`nUse Numpad key`nStar ( * )
TT_1_PlayIt=`nUse Either`nEnter Key
TT_1_Favorite=Use Numpad ( / ) to Show Peoples`nFavorites list, & Press first letter of name`nThen hit enter, Select song & Press enter
TT_1_SFX=Use Numpads Del key`nThen tap 0 to 9 multiple times`nfor multiple effects
TT_2_VisualHelpEnableMouseOverControls=`nShows help in the MAIN window`nRight where you see this now.
TT_2_HideUnusedModeLessScreenUsed=Shows only the USED windows`nEither Karaoke windows or DJ Windows.`nF1 Switches Between modes still.
TT_7_Saveandexit=saves settings and exits

Return
;----------------------------------------------------------------------------------
;  @@@@                            @@                     @@@                      ;
; @@  @@                           @@                      @@                      ;
;@@       @@@@   @@ @@@   @@@@@    @@       @@@@   @@@@    @@  @@     @@@@  @@@@@  ;
;@@          @@   @@  @@ @@        @@      @@  @@ @@  @@   @@ @@     @@  @@ @@  @@ ;
;@@       @@@@@   @@  @@  @@@@     @@      @@  @@ @@       @@@@      @@  @@ @@  @@ ;
; @@  @@ @@  @@   @@@@@      @@    @@      @@  @@ @@  @@   @@ @@     @@  @@ @@  @@ ;
;  @@@@   @@@ @@  @@     @@@@@     @@@@@@   @@@@   @@@@   @@@  @@     @@@@  @@  @@ ;
;----------------@@@---------------------------------------------------------------;
;tag
;Caps Lock on:
Caps:
   If GetKeyState("CapsLock","T")
   SoundBeep, 2200,15
   ;      SoundPlay, C:\WINDOWS\MEDIA\Windows XP Pop-up Blocked.wav
Return
;-------------------------------------------------
;@@@@@@                    @@@  @@@@ @@   @@ @@@@ ;
; @@  @@                    @@   @@  @@@  @@  @@  ;
; @@  @@  @@@@   @@@@       @@   @@  @@@@ @@  @@  ;
; @@@@@  @@  @@     @@   @@@@@   @@  @@ @@@@  @@  ;
; @@ @@  @@@@@@  @@@@@  @@  @@   @@  @@  @@@  @@  ;
; @@  @@ @@     @@  @@  @@  @@   @@  @@   @@  @@  ;
;@@@  @@  @@@@   @@@ @@  @@@ @@ @@@@ @@   @@ @@@@ ;
;-------------------------------------------------;
;tag
;INIRead 1;
readini:
xr1=200
xr2=200
Iniread,test,%_ini%,1,gui
if test=ERROR
{
loop %Guinum%
   {
xr1:=(xr1+20)
xr2:=(xr2+20)
IniWrite,%xr1% %xr2% %z2%,%_ini%,%A_Index%,loc
   }
loop %Guinum%
   {
   IniWrite,190 190 %z2%,%_ini%,%A_Index%,gui
   }
   IniWrite,634 75 Main,%_ini%,1,gui
   IniWrite,634 250 Setup,%_ini%,2,gui
   Iniwrite,1,%_ini%,ON-OFF,MOUSEOVER
MsgBox,0,,INI FILE CREATED OR MODIFIED,5
Reload
}
;This bit loops the GUI vars
Loop %Guinum%
{
_x%A_Index%x=
_y%A_Index%x=
_ab%A_Index%=
_ac%A_Index%=
x%A_Index%=
y%A_Index%=
}
Loop %Guinum%
{
      Iniread,_a%A_Index%,%_ini%,%A_Index%,loc
      Iniread,_b%A_Index%,%_ini%,%A_Index%,gui
}   
Loop %Guinum%
{
StringSplit,_x%A_Index%x,_a%A_Index%,%A_Space%,%A_Space%
x1:=_x%A_Index%x1
x2:=_x%A_Index%x2
StringSplit,_y%A_Index%x,_b%A_Index%,%A_Space%,%A_Space%
x3:=_y%A_Index%x1
x4:=_y%A_Index%x2
if x3<50
x1=100
if x4<50
x2=100
if x3<50
x3=100
if x4<50
x4=100
rs%A_Index%x:=x3
rs%A_Index%y:=x4
ax%A_Index%:=x1
ay%A_Index%:=x2
aw%A_Index%:=x3
ah%A_Index%:=x4
_spx:=_x1x1
_spy:=_x1x2
y3:=x3-20
y4:=Round(x4/15)-2
_ab%A_Index%=R%y4% W%y3% ;
}
;--------------------------------------------------------
;@@@@@@                    @@@  @@@@ @@   @@ @@@@  @@@@  ;
; @@  @@                    @@   @@  @@@  @@  @@  @@  @@ ;
; @@  @@  @@@@   @@@@       @@   @@  @@@@ @@  @@      @@ ;
; @@@@@  @@  @@     @@   @@@@@   @@  @@ @@@@  @@    @@@  ;
; @@ @@  @@@@@@  @@@@@  @@  @@   @@  @@  @@@  @@   @@    ;
; @@  @@ @@     @@  @@  @@  @@   @@  @@   @@  @@  @@  @@ ;
;@@@  @@  @@@@   @@@ @@  @@@ @@ @@@@ @@   @@ @@@@ @@@@@@ ;
;--------------------------------------------------------;
;tag
;INIRead 2:
;the other ini options
Iniread,_tt,%_ini%,ON-OFF,MOUSEOVER
if _tt=1
OnMessage(0x200,"MOUSEOVER")

Iniread,_hm,%_ini%,ON-OFF,hidemode

Return
;-------------------------------------------------------------------
;@@   @@                                @@@                         ;
;@@@ @@@                               @@ @@                        ;
;@@@@@@@  @@@@  @@  @@   @@@@@  @@@@  @@   @@ @@  @@  @@@@  @@ @@@  ;
;@@@@@@@ @@  @@ @@  @@  @@     @@  @@ @@   @@ @@  @@ @@  @@  @@@ @@ ;
;@@ @ @@ @@  @@ @@  @@   @@@@  @@@@@@ @@   @@ @@  @@ @@@@@@  @@  @@ ;
;@@   @@ @@  @@ @@  @@      @@ @@      @@ @@   @@@@  @@      @@     ;
;@@   @@  @@@@   @@@ @@ @@@@@   @@@@    @@@     @@    @@@@  @@@@    ;
;-------------------------------------------------------------------;
;tag
;MouseOver:
MOUSEOVER()
{
If A_Gui=<0 ;check if mouse is not on any gui
{
   SetTimer,cls,-250
   Vkey:=
   ControlSetText,,%vkey%,Status
   Return
}
   {
   SetTimer cls,8000
   MouseGetPos, X,Y,,, ;get the mouse co-ordinates
   _tword=%A_GuiControl% ;make A_GuiControl a modifyable variable
   StringReplace,_tword,_tword,%A_Space%,,all ;remove the spaces so it can find the tooltip
   StringReplace,_tword,_tword,~,,all ;remove ~
   StringReplace,_tword,_tword,+,,all ;remove +
   StringReplace,_tword,_tword,*,,all ;remove *
   StringReplace,_tword,_tword,/,,all ;remove /
   StringReplace,_tword,_tword,(,,all ;remove (
   StringReplace,_tword,_tword,),,all ;remove )
   StringReplace,_tword,_tword,-,,all ;remove -
   StringReplace,_tword,_tword,:,,all ;remove :
   StringReplace,_tword,_tword,\,,all ;remove \
   StringReplace,_tword,_tword,.,,all ;remove .
   StringReplace,_tword,_tword,`n,,all ;remove any line returns
   _tip:=TT_%A_Gui%_%_tword% ;get the tooltip to display
   C_Gui:=A_Gui
   ;   Tooltip ;%_tip%,%X%,%Y% ;display it
   Vkey:=TT_%A_Gui%_%_tword%
   WinGetPos,GX,GY,GW,GH,Main
_spx:=(GX+330)
_spy:=(GY+47)
   ControlSetText,,%vkey%,Status
   WinMove,Status,%vkey%,%_spx%,%_spy%
   }
}   
Return
;-----------------------------------------------------------
;@@@   @   @@      @@@   @  @@@@       @@@@  @@      @@  @@ ;
;@ @  @   @@@      @ @  @  @@  @@     @@  @@ @@      @@  @@ ;
;@@@ @     @@      @@@ @       @@    @@      @@      @@  @@ ;
;   @      @@         @      @@@     @@      @@      @@  @@ ;
;  @ @@@   @@        @ @@@  @@       @@      @@      @@  @@ ;
; @  @ @   @@       @  @ @ @@  @@     @@  @@ @@       @@@@  ;
;@   @@@ @@@@@@    @   @@@ @@@@@@      @@@@  @@@@@@    @@   ;
;-----------------------------------------------------------;
;tag
;CL Params:
   

; process command line parameters -- DEBUG: optional (see above)
getParams:
   If 0 > 0
   {
      Loop, %0% ; for each parameter
      {
         param := %A_Index%
         ; check for switches
         StringLeft, paramType, param, 1
         If paramType = - ; switch indicator
         {
            ; determine type of switch
            StringMid, switch, param, 2, 1
            ; switch
            If switch = x ; DEBUG: template (replace "x")
            {
               ; access value (= next parameter)
               param = % A_Index + 1
               var_x := %param% ; DEBUG: template (replace "var_x")
            }
         }
      }
   }
Return
;------------------------------------------------------------
;@@@@@@                        @@   @@                       ;
;  @@                          @@@ @@@                       ;
;  @@   @@ @@@   @@@@   @@  @@ @@@@@@@  @@@@  @@@@@  @@  @@  ;
;  @@    @@@ @@     @@  @@  @@ @@@@@@@ @@  @@ @@  @@ @@  @@  ;
;  @@    @@  @@  @@@@@  @@  @@ @@ @ @@ @@@@@@ @@  @@ @@  @@  ;
;  @@    @@     @@  @@   @@@@@ @@   @@ @@     @@  @@ @@  @@  ;
;  @@   @@@@     @@@ @@     @@ @@   @@  @@@@  @@  @@  @@@ @@ ;
;------------------------@@@@--------------------------------;
;tag
;TrayMenu:
trayMenu:
   ; set tray tip
   Menu, Tray, Tip, %programFullName%
   ; disable standard menu items
   Menu, Tray, NoStandard
   ; show info message
   Menu, Tray, Add, &About, about
   ; separator
   Menu, Tray, Add
   ; show Setup message
   Menu, Tray, Add, &Setup, setup
   ; separator
   Menu, Tray, Add
   ; terminate script
   Menu, Tray, Add, &Quit, quit
Return
;-------------------------------------------------------------------------
;  @@@@  @@@                           @@@@           @                   ;
; @@  @@  @@                          @@  @@         @@                   ;
;@@       @@   @@@@   @@@@@  @@@@     @@@     @@@@  @@@@@ @@  @@  @@ @@@  ;
;@@       @@  @@  @@ @@     @@  @@     @@@   @@  @@  @@   @@  @@   @@  @@ ;
;@@       @@  @@  @@  @@@@  @@@@@@       @@@ @@@@@@  @@   @@  @@   @@  @@ ;
; @@  @@  @@  @@  @@     @@ @@        @@  @@ @@      @@ @ @@  @@   @@@@@  ;
;  @@@@  @@@@  @@@@  @@@@@   @@@@      @@@@   @@@@    @@   @@@ @@  @@     ;
;-----------------------------------------------------------------@@@-----;
;tag
;Setup close:
closesetup:
Gui, 2:Submit
ControlSetText,,%vkey%,Status
WinSet,Redraw,,Status
vkey=Close Setup
gosub history
ControlFocus,Edit2,Main
Return
;---------------------------------------------------------------------
; @@@@  @@@                        @@@@           @                   ;
;@@  @@  @@                       @@  @@         @@                   ;
;@@@     @@ @@   @@@@  @@   @@    @@@     @@@@  @@@@@ @@  @@  @@ @@@  ;
; @@@    @@@ @@ @@  @@ @@ @ @@     @@@   @@  @@  @@   @@  @@   @@  @@ ;
;   @@@  @@  @@ @@  @@ @@@@@@@       @@@ @@@@@@  @@   @@  @@   @@  @@ ;
;@@  @@  @@  @@ @@  @@ @@@ @@@    @@  @@ @@      @@ @ @@  @@   @@@@@  ;
; @@@@  @@@  @@  @@@@  @@   @@     @@@@   @@@@    @@   @@@ @@  @@     ;
;-------------------------------------------------------------@@@-----;
;tag
;Setup show:
setup:
IfWinExist,Setup
{
   Gosub closesetup
   Return
}
Gui, 2:Show,xCenter yCenter,Setup
vkey=Activate Setup
gosub history
Return
;-------------------------------------
;  @@    @@@                      @   ;
; @@@@    @@                     @@   ;
;@@  @@   @@      @@@@  @@  @@  @@@@@ ;
;@@  @@   @@@@@  @@  @@ @@  @@   @@   ;
;@@@@@@   @@  @@ @@  @@ @@  @@   @@   ;
;@@  @@   @@  @@ @@  @@ @@  @@   @@ @ ;
;@@  @@  @@ @@@   @@@@   @@@ @@   @@  ;
;-------------------------------------;
;tag
;About:
about:
   MsgBox, 64, %programFullName%,
   ( LTrim
      %programFullName%
      %A_Space%by %programAuthor%

      Professional Universal Karaoke Front end

      http://trubbleguy.com
     
      Use [ALT]+[ESC] to terminate the program.
   )
Return
;---------------------------
; @@@@            @@    @   ;
;@@  @@                @@   ;
;@@  @@  @@  @@  @@@  @@@@@ ;
;@@  @@  @@  @@   @@   @@   ;
;@@ @@@  @@  @@   @@   @@   ;
; @@@@   @@  @@   @@   @@ @ ;
;   @@@   @@@ @@ @@@@   @@  ;
;---------------------------;
;tag
;Quit:
exit:
quit:
GuiClose:
wind=1%A_Tab%Main^3%A_Tab%Karaoke Search^4%A_Tab%Rotation^5%A_Tab%Kj Favorites^6%A_Tab%Dj Search^7%A_Tab%Dj Playlist^8%A_Tab%Dj Favorites
Gosub sizer
ExitApp
;-------------------------------------------
; @@@@          @@@                 @@@     ;
;@@  @@          @@                  @@     ;
;@@@    @@ @@@   @@   @@@@    @@@@@  @@ @@  ;
; @@@    @@  @@  @@      @@  @@      @@@ @@ ;
;   @@@  @@  @@  @@   @@@@@   @@@@   @@  @@ ;
;@@  @@  @@@@@   @@  @@  @@      @@  @@  @@ ;
; @@@@   @@     @@@@  @@@ @@ @@@@@  @@@  @@ ;
;-------@@@---------------------------------;
;tag
;Splash:
splash:
   IfWinExist,Status
   {
   SetTitleMatchMode 2   
   ControlSetText,,%vkey%,Status
   WinSet,Redraw,,Status
   }   
   Else
   {
   Progress,y17 zh0 zy1  B c10 CWdefault CT010000 fs10,%vkey%,%A_Index%,Status
   WinMove,Status,%vkey%,1,1
   }
   Return
;-----------------------
; @@@@  @@@@@@  @@      ;
;@@  @@  @@  @@ @@      ;
;@@@     @@  @@ @@      ;
; @@@    @@@@@  @@      ;
;   @@@  @@     @@      ;
;@@  @@  @@     @@      ;
; @@@@  @@@@    @@@@@@  ;
;-----------------------;
;tag
spl:
WinGetPos,GX,GY,GW,GH,Main
_spx:=(GX+317)
_spy:=(GY+47)
WinMove,Status,%vkey%,%_spx%,%_spy%
ControlSetText,,%vkey%,Status
Return
;WinSet, TransColor,Default,Status
;WinSet, Transparent,140,Status
;------------------------------------------------------------------------------------------
; @@@@                           @@@      @@@@@@   @@@    @@@                   @          ;
;@@  @@                           @@      @@      @@ @@  @@ @@                 @@          ;
;@@@     @@@@  @@  @@  @@@@@      @@      @@      @@     @@     @@@@   @@@@   @@@@@  @@@@@ ;
; @@@   @@  @@ @@  @@  @@  @@  @@@@@      @@@@   @@@@   @@@@   @@  @@ @@  @@   @@   @@     ;
;   @@@ @@  @@ @@  @@  @@  @@ @@  @@      @@      @@     @@    @@@@@@ @@       @@    @@@@  ;
;@@  @@ @@  @@ @@  @@  @@  @@ @@  @@      @@      @@     @@    @@     @@  @@   @@ @     @@ ;
; @@@@   @@@@   @@@ @@ @@  @@  @@@ @@     @@@@@@ @@@@   @@@@    @@@@   @@@@     @@  @@@@@  ;
;------------------------------------------------------------------------------------------;
;tag
;Sound Effects:
sfx:
Input, UserInput,T1 L1,{Escape},0,1,2,3,4,5,6,7,8,9
if ErrorLevel = Timeout
  return
; Otherwise, a match was found.
sfx1:
SetKeyDelay, -1  ; Most editors can handle the fastest speed.
Loop, %A_ScriptDir%\se\%UserInput%\*.*
   Run, %A_ScriptDir%\Wav.exe "%A_ScriptDir%\se\%UserInput%\%A_LoopFileName%"
;   Run, %A_ScriptDir%\Wav.exe %A_ScriptDir%\se\%UserInput%\%A_LoopFileName% /Q,,Hide
vkey=done
gosub splash
goto sfx
sfxapplause:
Loop, %A_ScriptDir%\se\0\*.*
Run, %A_ScriptDir%\Wav.exe "%A_ScriptDir%\se\0\%A_LoopFileName%"
Return
;--------------------
;        @@@         ;
;         @@         ;
; @@@@    @@   @@@@@ ;
;@@  @@   @@  @@     ;
;@@       @@   @@@@  ;
;@@  @@   @@      @@ ;
; @@@@   @@@@ @@@@@  ;
;--------------------;
;tag
cls:
SetTimer,cls,off
If A_Gui>0
Return
Vkey:=
ControlSetText,,%vkey%,Status
Return
;--------------------------------------------------------------------------------
;@@@@@@               @@@    @    @@                                 @@@    @@@  ;
;  @@                  @@   @@                                      @@ @@  @@ @@ ;
;  @@    @@@@   @@@@   @@  @@@@@ @@@  @@ @@@   @@@@  @@@@@   @@@@   @@     @@    ;
;  @@   @@  @@ @@  @@  @@   @@    @@   @@  @@ @@  @@ @@  @@ @@  @@ @@@@   @@@@   ;
;  @@   @@  @@ @@  @@  @@   @@    @@   @@  @@ @@  @@ @@  @@ @@  @@  @@     @@    ;
;  @@   @@  @@ @@  @@  @@   @@ @  @@   @@@@@  @@  @@ @@  @@ @@  @@  @@     @@    ;
;  @@    @@@@   @@@@  @@@@   @@  @@@@  @@      @@@@  @@  @@  @@@@  @@@@   @@@@   ;
;-------------------------------------@@@----------------------------------------;
;tag
Tooltiponoff:
_tt=
OnMessage(0x200,"MOUSEOVER")=OnMessage(0x200,"")
GuiControlGet,_tt,,Button17
Iniwrite,%_tt%,%_ini%,ON-OFF,MOUSEOVER
if _tt=1
OnMessage(0x200,"MOUSEOVER")
Vkey=Visual help is Now OFF
if _tt=1
Vkey=Visual help is Now On
gosub history
Return
;------------------------------------
; @@@@@@ @@@                 @@@     ;
; @@      @@                  @@     ;
; @@      @@   @@@@    @@@@@  @@ @@  ;
; @@@@    @@      @@  @@      @@@ @@ ;
; @@      @@   @@@@@   @@@@   @@  @@ ;
; @@      @@  @@  @@      @@  @@  @@ ;
; @@     @@@@  @@@ @@ @@@@@  @@@  @@ ;
;------------------------------------;
;tag
Flash:
Gui,%zgui%:Flash
Vkey=Now select New lower right hand corner`nBy Left click where you think it should be.`nYou Have 3 seconds to act.
   ControlSetText,,%vkey%,Status
Return
;------------------------------------------------------------
;@@  @@  @@     @@@            @@   @@           @@@         ;
;@@  @@          @@            @@@ @@@            @@         ;
;@@  @@ @@@      @@   @@@@     @@@@@@@  @@@@      @@   @@@@  ;
;@@@@@@  @@   @@@@@  @@  @@    @@@@@@@ @@  @@  @@@@@  @@  @@ ;
;@@  @@  @@  @@  @@  @@@@@@    @@ @ @@ @@  @@ @@  @@  @@@@@@ ;
;@@  @@  @@  @@  @@  @@        @@   @@ @@  @@ @@  @@  @@     ;
;@@  @@ @@@@  @@@ @@  @@@@     @@   @@  @@@@   @@@ @@  @@@@  ;
;------------------------------------------------------------;
;tag
hidemode1:
GuiControlGet,_hm,,Button18
Iniwrite,%_hm%,%_ini%,ON-OFF,hidemode
vkey=Hide Inactive Window Setting Off
If _hm=1
vkey=Hide Inactive Window Setting On
gosub history
hidemode:
Iniread,_hm,%_ini%,ON-OFF,hidemode
;MsgBox % _hm
if _hm=1

   {
   If _activemode=karaoke
      {
      gosub hidedj
      WinActivate,Setup
      Return
      }
   If _activemode=dj
      {
      gosub hideKaraoke
      WinActivate,Setup
      Return
      }
   }
Gui, 3:Show, x%ax3% y%ay3% , Karaoke Search
Gui, 4:Show, x%ax4% y%ay4% , Rotation
Gui, 5:Show, x%ax5% y%ay5% , Kj Favorites
Gui, 6:Show, x%ax6% y%ay6% , Dj Search
Gui, 7:Show, x%ax7% y%ay7% , Dj Playlist
Gui, 8:Show, x%ax8% y%ay8% , Dj Favorites
WinActivate,Setup
Return
;---------------------------------------------------------------------------------
;@@  @@  @@     @@@         @@@  @@                                @@@            ;
;@@  @@          @@          @@  @@                                 @@            ;
;@@  @@ @@@      @@   @@@@   @@ @@   @@@@   @@ @@@   @@@@    @@@@   @@  @@  @@@@  ;
;@@@@@@  @@   @@@@@  @@  @@  @@@@       @@   @@@ @@     @@  @@  @@  @@ @@  @@  @@ ;
;@@  @@  @@  @@  @@  @@@@@@  @@ @@   @@@@@   @@  @@  @@@@@  @@  @@  @@@@   @@@@@@ ;
;@@  @@  @@  @@  @@  @@      @@  @@ @@  @@   @@     @@  @@  @@  @@  @@ @@  @@     ;
;@@  @@ @@@@  @@@ @@  @@@@  @@@  @@  @@@ @@ @@@@     @@@ @@  @@@@  @@@  @@  @@@@  ;
;---------------------------------------------------------------------------------;
;tag
hidekaraoke:
wind=3%A_Tab%Karaoke Search^4%A_Tab%Rotation^5%A_Tab%Kj Favorites
Gosub sizer
Gui, 6:Show
Gui, 7:Show
Gui, 8:Show
ControlSetText,,`nDisc Jockey Mode,Status
WinActivate,Main
If _hm<>1
Return
Gui, 3:Submit
Gui, 4:Submit
Gui, 5:Submit
Return
;------------------------------------------
;@@  @@  @@     @@@         @@@@@       @@ ;
;@@  @@          @@          @@ @@         ;
;@@  @@ @@@      @@   @@@@   @@  @@     @@ ;
;@@@@@@  @@   @@@@@  @@  @@  @@  @@     @@ ;
;@@  @@  @@  @@  @@  @@@@@@  @@  @@     @@ ;
;@@  @@  @@  @@  @@  @@      @@ @@  @@  @@ ;
;@@  @@ @@@@  @@@ @@  @@@@  @@@@@   @@  @@ ;
;------------------------------------@@@@--;
;tag
hidedj:
wind=6%A_Tab%Dj Search^7%A_Tab%Dj Playlist^8%A_Tab%Dj Favorites
Gosub sizer
Gui, 3:Show
Gui, 4:Show
Gui, 5:Show
ControlSetText,,`nKaraoke Mode,Status
WinActivate,Main
If _hm<>1
Return
Gui, 6:Submit
Gui, 7:Submit
Gui, 8:Submit
Return
;-----------------------------------------------------------------------
;  @                          @@@                           @@@         ;
; @@                           @@                            @@         ;
;@@@@@  @@@@   @@@ @@  @@@ @@  @@   @@@@  @@  @@   @@@@      @@   @@@@  ;
; @@   @@  @@ @@  @@  @@  @@   @@  @@  @@ @@@ @@@ @@  @@  @@@@@  @@  @@ ;
; @@   @@  @@ @@  @@  @@  @@   @@  @@@@@@ @@@@@@@ @@  @@ @@  @@  @@@@@@ ;
; @@ @ @@  @@  @@@@@   @@@@@   @@  @@     @@ @ @@ @@  @@ @@  @@  @@     ;
;  @@   @@@@      @@      @@  @@@@  @@@@  @@   @@  @@@@   @@@ @@  @@@@  ;
;--------------@@@@----@@@@---------------------------------------------;
;tag
togglemode:
;   {
;   Gui, 3:Show
;   Gui, 4:Show
;   Gui, 5:Show
;   Gui, 6:Show
;   Gui, 7:Show
;   Gui, 8:Show
;   WinActivate,Main
;   }
;MsgBox % _activemode
If _activemode=karaoke
   {
   gosub hidekaraoke
   _activemode=dj
   vkey=DJ Mode Active
   Gosub history
   WinActivate,Main
   Return
   }
If _activemode=dj
   {
   gosub hidedj
   vkey=Karaoke Mode Active
   Gosub history
   _activemode=karaoke
   WinActivate,Main
   Return
   }
return
;tag
newsize:
Return
;------------------------------------------------------------------------------------------------
;  @@                   @@@                        @@@@                   @    @@                ;
; @@@@                   @@                       @@  @@                 @@                      ;
;@@  @@  @@@@@   @@@@    @@ @@   @@@@  @@ @@@     @@@     @@@@   @@@@   @@@@@ @@@   @@@@  @@@@@  ;
;@@  @@  @@  @@ @@  @@   @@@ @@ @@  @@  @@@ @@     @@@   @@  @@ @@  @@   @@    @@  @@  @@ @@  @@ ;
;@@@@@@  @@  @@ @@       @@  @@ @@  @@  @@  @@       @@@ @@@@@@ @@       @@    @@  @@  @@ @@  @@ ;
;@@  @@  @@  @@ @@  @@   @@  @@ @@  @@  @@        @@  @@ @@     @@  @@   @@ @  @@  @@  @@ @@  @@ ;
;@@  @@  @@  @@  @@@@   @@@  @@  @@@@  @@@@        @@@@   @@@@   @@@@     @@  @@@@  @@@@  @@  @@ ;
;------------------------------------------------------------------------------------------------;
;tag
;Anchor:

GuiSize:
;SetFormat, Integer, Hex
DllCall("QueryPerformanceCounter", "Int64P", t0)
;Anchor("edit", "w")
Anchor("f1", "")
GuiWidth := A_GuiWidth
DllCall("QueryPerformanceCounter", "Int64P", t1)
;MsgBox, % clipboard := (t1 - t0) / freq
Return

3GuiSize:
Anchor("list3", "w h")
Return

4GuiSize:
Anchor("list4", "w h")
Return

5GuiSize:
Anchor("list5", "w h")
Return

6GuiSize:
Anchor("list6", "w h")
Return

7GuiSize:
Anchor("list7", "w h")
Return

8GuiSize:
Anchor("list8", "w h")
Return

;----------------------------------------------
; @@@@                                 @@@     ;
;@@  @@                                 @@     ;
;@@@     @@@@   @@@@   @@ @@@   @@@@    @@ @@  ;
; @@@   @@  @@     @@   @@@ @@ @@  @@   @@@ @@ ;
;   @@@ @@@@@@  @@@@@   @@  @@ @@       @@  @@ ;
;@@  @@ @@     @@  @@   @@     @@  @@   @@  @@ ;
; @@@@   @@@@   @@@ @@ @@@@     @@@@   @@@  @@ ;
;----------------------------------------------;
;tag
search:
ControlSetText,,Type your search,Status
vkey=Search for a Song
gosub history
ControlFocus,Edit2,Main
_focus =`,Edit2`,Main`,
send ^a
Return
;----------------------------------------------------------------------------------------
;@@@      @@           @                                                       @@@  @@@  ;
; @@                  @@                                                        @@   @@  ;
; @@ @@  @@@   @@@@@ @@@@@  @@@@  @@ @@@  @@  @@  @@@@@  @@@@   @@ @@@   @@@@   @@   @@  ;
; @@@ @@  @@  @@      @@   @@  @@  @@@ @@ @@  @@ @@     @@  @@   @@@ @@ @@  @@  @@   @@  ;
; @@  @@  @@   @@@@   @@   @@  @@  @@  @@ @@  @@  @@@@  @@       @@  @@ @@  @@  @@   @@  ;
; @@  @@  @@      @@  @@ @ @@  @@  @@      @@@@@     @@ @@  @@   @@     @@  @@  @@   @@  ;
;@@@  @@ @@@@ @@@@@    @@   @@@@  @@@@        @@ @@@@@   @@@@   @@@@     @@@@  @@@@ @@@@ ;
;------------------------------------------@@@@------------------------------------------;
;tag
history:
ControlSetText,,%vkey%,Status
ControlSend,Edit1,`n%vkey%,Main
;ControlFocus _focus
return

any other hints would be helpful as i have a lot of linking to do and plugins to create. but the gui's are working pretty good, and command history and mousover etc... i assume you have anchor.ahk handy......lol
this script is much easier to read using my subscript prog, but the bignotes make finding code easy too.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2007, 4:41 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
Everything seems normal to me. I can resize and move any window and I get the expected result. Isolating and disabling those routines made no difference. Maybe I missed something?

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2007, 12:04 am 
Offline

Joined: January 20th, 2007, 1:29 pm
Posts: 96
Location: Melbourne
is your anchor capable of also somehow getting and storing X Y position of the actual window if its moved but not sized is what im asking, as in my code, sizer: has to get moved windows, your anchor works perfect on any sizing but not movement, can movement be detected and applied to a gui so if it is cancelled or submitted, when it is show it is in the new location, when i switched gui sets before, it remembered sizes but not locations.
so in the name, anchor will work with sized but not moved windows.
would not sizeAnchor be a truer name,
would a new posAnchor be a new idea as a sub???


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 2:00 am 
I didn't actually read all 9 pages (sorry) but, I couldn't help noticing that when I use Anchor to size a GUI, the buttons get all screwed up. Script I'm using:

Code:
Anchor(cl, a = "", r = 0) {
   static d, g, sd = 12, sg := 13, sc = 0, k = 0xffff, iz = 0, bx, by
   If !iz
      iz := 1, VarSetCapacity(g, sg * 99, 0), VarSetCapacity(d, sd * 200, 0)
   If cl is xdigit
      c = %cl%
   Else {
      GuiControlGet, c, Hwnd, %cl%
      If ErrorLevel {
         Gui, %A_Gui%:+LastFound
         ControlGet, c, Hwnd, , %cl%
      }
   }
   If !(A_Gui or c) and a
      Return
   cg := (A_Gui - 1) * sg
   Loop, %sc%
      If NumGet(d, z := (A_Index - 1) * sd) = c {
         p := NumGet(d, z + 4, "UInt64"), l := 1
            , x := p >> 48, y := p >> 32 & k, w := p >> 16 & k, h := p & k
            , gw := (gh := NumGet(g, cg + 1)) >> 16, gh &= k
         If a =
            Break
         Loop, Parse, a, xywh
            If A_Index > 1
            {
               v := SubStr(a, l, 1)
               If v in y,h
                  n := A_GuiHeight - gh
               Else n := A_GuiWidth - gw
               b = %A_LoopField%
               %v% += n * (b + 0 ? b : 1), l += StrLen(A_LoopField) + 1
            }
            Return, DllCall("SetWindowPos", "UInt", c, "Int", 0
               , "Int", x, "Int", y, "Int", w, "Int", h, "Int", r | 4)
      }
   ControlGetPos, x, y, w, h, , ahk_id %c%
   If !p {
      If NumGet(g, cg, "UChar") != A_Gui {
         Gui, %A_Gui%:+LastFound
         WinGetPos, , , , gh
         gh -= A_GuiHeight
         VarSetCapacity(bdr, 63, 0)
            , DllCall("GetWindowInfo", "UInt", WinExist(), "UInt", &bdr)
            , NumPut(A_Gui, g, cg, "UChar")
            , NumPut(A_GuiWidth << 16 | A_GuiHeight, g, cg + 1, "UInt")
            ,  NumPut((bx := NumGet(bdr, 48)) << 32
            | (by := gh - NumGet(bdr, 52)), g, cg + 5, "UInt64")
      }
      Else b := NumGet(g, cg + 5, "UInt64"), bx := b >> 32, by := b & 0xffffffff
   }
   s := x - bx << 48 | y - by << 32 | w << 16 | h
   If p
      NumPut(s, d, z + 4, "UInt64")
   Else NumPut(c, d, sc * 12), NumPut(s, d, sc * 12 + 4, "UInt64"), sc++
}


#SingleInstance Force

IfNotExist, c:\Max Trips.Ini
{
  InputBox, MaxWONote, Max Amounr of Trips Without a Note, Please choose a maxamium amount of trips without a note and type it in the edit control.
  IniWrite, %MaxWONote%, C:\Max Trips.ini, Max_Trips, WithoutNote
  InputBox, MaxWNote, Max Amounr of Trips With a Note, Please choose a maxamium amount of trips with a note and type it in the edit control.
  IniWrite, %MaxWNote%, C:\Max Trips.ini, Max_Trips, WithNote
  }
DllCall("QueryPerformanceFrequency", "Int64P", freq)
  Gui, +Resize  +MinSize
gosub,setup
Gui,add,Listbox,w500 r20 vstudent gupdate AltSubmit,%studentlist%
gui,add,edit,readonly vtrips section,
Gui,Add, Button,ys w20 r1 gPlus vplus, &+
Gui,Add, Button,ys w20 r1 gMinus vminus, &-
Gui,Add, Button,ys W70 r1 gadd vaddy, &Add Student
Gui,Add, Button,ys W70 r1 gdelete vdelete, Del &Student
Gui, Add, Button,ys W70 r1 gAdd_Note vAdd_Note, Add &Note
Gui, Add, Button,ys W70 r1 gDel_Note vDel_Note, &Del Note
gui,show, x183 y158 ,Hall Pass (v2.0.1.3)
Gui, +Owner2
Gui, 4:Add, Text, W100 r1 +Center, Name of student
Gui, 4:Add, Edit, W100 r1 vName +Center -WantReturn ,
Gui, 4:Add, Button, W100 h20 r1 gsubmit vsubmit Default, &Add
Gui, 4:Add, Button, W100 h20 r1 gPNote vPNote Default, Add &W/ Note
Gui, 4:+ToolWindow
Return

Add_Note:
Gui, Submit, NoHide
if (selected_id)
  {
    If (student_note%selected_id% = 0)
      {
        iniwrite, 0,Hall Pass.ini,%selected_id%,Note
      }
  }
Else   
  MsgBox,, D'oh!, No name selected!
Return

Del_Note:
Gui, Submit, NoHide 
if (selected_id)
  {
    If (student_note%selected_id% = 1)
      {
        iniwrite, 0,Hall Pass.ini,%selected_id%,Note
      }
  }
Else   
  MsgBox,, D'oh!, No name selected!
Return


setup:
studentlist:=""
students:=0
iniread,students,Hall Pass.ini,students,Students
loop,%students% {
  student_id:=A_index
  iniread,student_name%a_index%,Hall Pass.ini,%a_index%,Name
  iniread,student_trips%a_index%,Hall Pass.ini,%a_index%,Trips
  iniread,student_note%a_index%,Hall Pass.ini,%a_index%,Note,0
  studentlist.=student_name%a_index% "|"
}
return

Delete:
guicontrolget,selected_id,,Student
if (selected_id = students){
  inidelete,Hall Pass.ini,%selected_id%
  Students-=1
  Iniwrite,%students%,Hall Pass.ini,students,Students
}
{
  student_name%selected_id%:=student_name%students%
  student_trips%selected_id%:=student_trips%students%
  Iniwrite,% student_name%selected_id%,Hall Pass.ini,%selected_id%,Name
  IniWrite,% student_trips%selected_id%,Hall Pass.ini,%selected_id%,Trips
  inidelete,Hall Pass.ini,%students%
  Students-=1
  Iniwrite,%students%,Hall Pass.ini,students,Students
  gosub,setup
  Guicontrol,1:,Student,|%studentlist%
}
Return

Add:
gui,4:show,,Add Student
Return

Submit:
gui,4:submit
Students+=1
Iniwrite,%students%,Hall Pass.ini,students,Students
Iniwrite,%Name%,Hall Pass.ini,%students%,Name
IniWrite,0,Hall Pass.ini,%students%,Trips
IniWrite, 0, Hall Pass.ini, %Students%, Note
student_name%students%:=Name
student_trips%students%:=0
GuiControl,, Name
Guicontrol,1:,Student,%Name%
Return

PNote:
gui,4:submit
Students+=1
Iniwrite,%students%,Hall Pass.ini,students,Students
Iniwrite,%Name%,Hall Pass.ini,%students%,Name
IniWrite,0,Hall Pass.ini,%students%,Trips
IniWrite, 1, Hall Pass.ini, %Students%, Note
student_name%students%:=Name
student_trips%students%:=0
GuiControl,, Name
Guicontrol,1:,Student,%Name%
Return


update:
guicontrolget,selected_id,,Student
guicontrol,,trips,% student_trips%selected_id%
return

Plus:
Gui, Submit, NoHide
  IniRead, MaxNote, C:\Max Trips.ini, Max_Trips, WithoutNote
    IniRead, Max_Note, C:\Max Trips.ini, Max_Trips, WithNote
if (selected_id){
  if (student_note%selected_id% = 0 and student_trips%selected_id% = MaxNote) or (student_note%selected_id% = 1 and student_trips%selected_id% = Max_Note){
    MsgBox,, D'oh, The student has exceeded their max.
  }
  else {
    student_trips%selected_id%+=1
    guicontrol,,trips,% student_trips%selected_id%
    iniwrite,% student_trips%selected_id%,Hall Pass.ini,%selected_id%,Trips
  }
}
else {
  MsgBox,, Whoops!, No student selected.
}
Return
 

Minus:
guicontrolget,selected_id,,Student
if (selected_id){
  student_trips%selected_id%-=1
  guicontrol,,trips,% student_trips%selected_id%
  iniwrite,% student_trips%selected_id%,Hall Pass.ini,%selected_id%,Trips
}
Return

GuiSize:
Anchor("student", "wh")
Anchor("trips", "wy")
Anchor("plus", "xy")
Anchor("delete", "xy")
Anchor("Add_Note", "xy")
Anchor("Del_Note", "xy")
Anchor("addy", "xy")
Anchor("minus", "xy")
GuiWidth := A_GuiWidth
Return


GuiClose:
ExitApp


Anchor stuff is in red.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 2:05 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
Try using the last parameter, e.g. Anchor("minus", "xy", true)

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 2:15 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Thanks, oh and you may want to update this on your AHK.net. You have the 4.1. (latest version) as
Code:
<td>4.1</td>

When it should be:
Code:
<tb><a href="http://www.autohotkey.net/~Titan/dl/Anchor.ahk">4.1</a></tb>

I am correct, right?

Well anyways, it also looks like that for..

3.4.1, 3.1, 3.0, 1.1, and RC1

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 2:30 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Is there any way to get rid of the ripple type affect caused in edit, listbox, listview etc.. Controls?

Example:

Code:
Anchor(cl, a = "", r = true) {
   static d, g, sd = 12, sg := 13, sc = 0, k = 0xffff, iz = 0, bx, by
   If !iz
      iz := 1, VarSetCapacity(g, sg * 99, 0), VarSetCapacity(d, sd * 200, 0)
   Gui, %A_Gui%:+LastFound
   If cl is xdigit
      c = %cl%
   Else {
      GuiControlGet, c, Hwnd, %cl%
      If ErrorLevel
         ControlGet, c, Hwnd, , %cl%
   }
   If !(A_Gui or c) and a
      Return
   cg := (A_Gui - 1) * sg
   Loop, %sc%
      If NumGet(d, z := (A_Index - 1) * sd) = c {
         p := NumGet(d, z + 4, "UInt64"), l := 1
            , x := p >> 48, y := p >> 32 & k, w := p >> 16 & k, h := p & k
            , gw := (gh := NumGet(g, cg + 1)) >> 16, gh &= k
         If a =
            Break
         Loop, Parse, a, xywh
            If A_Index > 1
            {
               v := SubStr(a, l, 1)
               If v in y,h
                  n := A_GuiHeight - gh
               Else n := A_GuiWidth - gw
               b = %A_LoopField%
               %v% += n * (b + 0 ? b : 1), l += StrLen(A_LoopField) + 1
            }
            DllCall("SetWindowPos", "UInt", c, "Int", 0
               , "Int", x, "Int", y, "Int", w, "Int", h, "Int", 4)
            If r
               VarSetCapacity(rc, 16, 0), NumPut(x, rc, 0, "Int"), NumPut(y, rc, 4, "Int")
                  , NumPut(w + x, rc, 8, "Int"), NumPut(h + y, rc, 12, "Int")
                  , DllCall("InvalidateRect", "UInt", WinExist(), "UInt", &rc, "UInt", true)
            Return
      }
   ControlGetPos, x, y, w, h, , ahk_id %c%
   If !p {
      If NumGet(g, cg, "UChar") != A_Gui {
         WinGetPos, , , , gh
         gh -= A_GuiHeight
         VarSetCapacity(bdr, 63, 0)
            , DllCall("GetWindowInfo", "UInt", WinExist(), "UInt", &bdr)
            , NumPut(A_Gui, g, cg, "UChar")
            , NumPut(A_GuiWidth << 16 | A_GuiHeight, g, cg + 1, "UInt")
            ,  NumPut((bx := NumGet(bdr, 48)) << 32
            | (by := gh - NumGet(bdr, 52)), g, cg + 5, "UInt64")
      }
      Else b := NumGet(g, cg + 5, "UInt64"), bx := b >> 32, by := b & 0xffffffff
   }
   s := x - bx << 48 | y - by << 32 | w << 16 | h
   If p
      NumPut(s, d, z + 4, "UInt64")
   Else NumPut(c, d, sc * 12), NumPut(s, d, sc * 12 + 4, "UInt64"), sc++
}


#SingleInstance Force

Gui, +Resize
Gui, Add, Edit, W500 H500 vEdit
Gui, Show
Return

GuiSize:
Anchor("Edit", "wh")


Oh, note that I changed the default "false" in the function to true. So Anchor("Edit", "wh", true) will have no affect.

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 3:00 am 
Offline

Joined: September 23rd, 2007, 4:16 pm
Posts: 140
You can reduce the noticability by setting the background to white, try this:
Code:
Gui, +Resize
Gui, Margin, 0, 0
Gui, Color, FFFFFF
Gui, Add, Edit, W500 H500 vEdit
Gui, Show
Return

GuiSize:
Anchor("Edit", "wh")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2007, 11:22 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
dieom wrote:
Oh, note that I changed the default "false" in the function to true. So Anchor("Edit", "wh", true) will have no affect.
I suggest you leave the default to false, or change the Edit to use false. This is because only certain types of controls (i.e. Buttons and GroupBoxes) require this last parameter, for all others it will cause flickering as you see in your example.

dieom wrote:
You have the 4.1. (latest version) as <td>4.1</td>
Links in that table are for archived versions. Use the shiny green download button to get the latest version :P

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: stupid error/bug??
PostPosted: October 5th, 2007, 4:06 pm 
Everytime i try to run the icon_viewer ahk which in turn uses the anchor.ahk i get this error: Error at line 410.

Line text: numput(c,d,sc*12), numput(s,d,sc*12 + 4, "UINT64"), sc++
error: this line does not contain a recognized action.



i am using the newest version of anchor, what am i doing wrong???


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2007, 5:10 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
Update your version of AutoHotkey to the latest available on the website. If you still get errors it may be due to something in your script.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 24th, 2007, 1:43 pm 
Offline

Joined: February 5th, 2007, 12:19 pm
Posts: 192
Location: Osnabrück, Germany
I tried to make a Gui with three Editcontrols in one line and a checkbox to add another three Edits in a second line.

I wanted to control the height of the controls with anchor.

I did not got it to work with hide and show.

So I tried it with Gui, destroy without success.
At last it works with resetting the static vars of anchor.

So I made another parameter for anchor to reset the static vars.

Can it be done another way or is it a real "error"?

Here is an example code:
Code:
ew   := 232
eh   := 200
ex1  := 10
ex2  := 2*ex1 + ew
ex3  := 3 * ex1 + 2 * ew
ewg  := 5 * ex1 + 3 * ew
ey1  := 30
ey2  := 250
cy1  := 2 *eh + ey1 + 30
cy2  := eh + ey1 + 30
six := 0

  Gui, +Resize
  Gui, Add, Edit, x%ex1% y%ey1% w%ew% h%eh% HWNDhEdita   vMyEdit1 -WantTab, edit1
  Gui, Add, Edit, x%ex2% y%ey1% w%ew% h%eh% HWNDhEditb vMyEdit2  -WantTab, edit2
  Gui, Add, Edit, x%ex3% y%ey1% w%ew% h%eh% HWNDhEditc vMyEdit3  -WantTab, edit3
  Gui, Add, Checkbox, x%ex2% y%cy2% 150 vsix gshowEdits,weitere edits
Gui, Show,h300  , %programName%
test := 1
Return

GuiSize:
if (test = 3)   
  Anchor("MyEdit1","h",false,true )
else if (test = 1)
{
   Anchor("MyEdit1", "h")
   Anchor("MyEdit2", "h")
   Anchor("MyEdit3", "h")
   Anchor("six", "y")
}else if (test = 2)
{
   Anchor("MyEdit1", "h0.5")
   Anchor("MyEdit2", "h0.5")
   Anchor("MyEdit3", "h0.5")
   Anchor("MyEdit4", "y0.5 h0.5")
   Anchor("MyEdit5", "y0.5 h0.5")
   Anchor("MyEdit6", "y0.5 h0.5")
   Anchor("six", "y")   
}
WinSet, redraw
Return

showEdits:
Gui, Submit, NoHide
   test := 3
   GuiControl, Move, MyEdit1, x1 ;reset anchor
  If (six = 1)
  {
   gui, destroy
   Gui, +Resize
   Gui, Add, Edit, x%ex1% y%ey1% w%ew% h%eh% HWNDhEdita vMyEdit1  -WantTab, edit1
   Gui, Add, Edit, x%ex2% y%ey1% w%ew% h%eh% HWNDhEditb vMyEdit2  -WantTab, edit2
   Gui, Add, Edit, x%ex3% y%ey1% w%ew% h%eh% HWNDhEditc vMyEdit3  -WantTab, edit3
   Gui, Add, Edit, x%ex1% y%ey2% w%ew% h%eh% HWNDhEditd vMyEdit4  -WantTab, edit4
   Gui, Add, Edit, x%ex2% y%ey2% w%ew% h%eh% HWNDhEdite vMyEdit5  -WantTab, edit5
   Gui, Add, Edit, x%ex3% y%ey2% w%ew% h%eh% HWNDhEditf vMyEdit6  -WantTab, edit6
   Gui, Add, Checkbox, x%ex2% y%cy1% checked-1 w%ew% vsix gshowEdits,weniger edits
   Gui, Show, h520 , %programName%
   test := 2
  }else if (six = 0)
   {
    gui, destroy
   Gui, +Resize
   Gui, Add, Edit, x%ex1% y%ey1% w%ew% h%eh% HWNDhEdita vMyEdit1  -WantTab, edit1
   Gui, Add, Edit, x%ex2% y%ey1% w%ew% h%eh% HWNDhEditb vMyEdit2  -WantTab, edit2
   Gui, Add, Edit, x%ex3% y%ey1% w%ew% h%eh% HWNDhEditc vMyEdit3  -WantTab, edit3
   Gui, Add, Checkbox, x%ex2% y%cy2%  w%ew% vsix gshowEdits,weitere Edits
   Gui, Show, h300 , %programName%
    test := 1
   }
return

GuiClose:
GuiEscape:
  ExitApp


and in anchor I added to the first lines:
Code:
Anchor(cl, a = "", r = false,SVreset = false) {
   static d, g, sd = 12, sg := 13, sc = 0, k = 0xffff, iz = 0, bx, by

   If SVreset
        d:="" ,g:="" ,sd = 12,sg := 13,sc = 0,k = 0xffff,iz = 0,bx :="" ,by :="" ,sg := 13




Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 24th, 2007, 10:46 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
haichen wrote:
.... At last it works with resetting the static vars of anchor.

I had a similar problem a while back. I modified Anchor v3.5.1 to fix the problem but I hadn't gotten around to making the modification the latest version until you posted your simple but elegant solution. Thanks!

As you discovered, reusing GUI objects is a problem. Based upon your solution, I made a similar modification to the function but instead of adding a parameter, I had the function look for a special control name.

Code:
Anchor(cl, a = "", r = false) {
    static d, g, sd = 12, sg := 13, sc = 0, k = 0xffff, iz = 0, bx, by
    if cl=$Reset$
        {
        d:="" ,g:="" ,sc=0 ,iz=0 ,bx:="" ,by:=""
        return
        }

...
...

This method allows the "reset" operation to be performed independent of the GUISize routine. Just perform the "Reset" command before building/rebuilding any GUI that needs to reuse an object. For example:

Code:
Anchor("$Reset$")

;-- Rebuild GUI
gui, destroy
Gui, +Resize
Gui, Add, Edit, x%ex1% y%ey1% w%ew% h%eh% HWNDhEdita vMyEdit1  -WantTab, edit1
...
...

I haven't tested this from top to bottom but it appears to do the trick. Thanks for the idea/code. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2007, 12:30 am 
Offline

Joined: February 5th, 2007, 12:19 pm
Posts: 192
Location: Osnabrück, Germany
Wow very nice! It works wonderful and it's not in the Guisize Routine. What want I more? And put the Reset-command in the controlfield: That is elegant!
Thanks a lot! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2007, 9:05 pm 
Offline

Joined: March 19th, 2006, 5:52 am
Posts: 419
I have a gui with 3 tabs that each have at least one list view on them. The resize works fine if the gui opens with the default size. I use a ini file to save the previous gui size. Reopening the gui, after closing it at a larger size, opens the gui at the larger size and the listview on the first tab is resized. However the list views on the other tabs are not resized. And since I increase the size of each column based on the gui size, this causes problems with the look of the list views. This was also happening when I was using version 3.3.

Here is a stripped down version of my script just to show the effect I am talking about.
Code:
#SingleInstance, Force
; ------ Collect Variable Preferences
IniRead, LastGuiX, AbsoulteSolution.ini, Gui, guiX, Center
IniRead, LastGuiY, AbsoulteSolution.ini, Gui, guiY, Center
IniRead, LastGuiH, AbsoulteSolution.ini, Gui, guiH, 400
IniRead, LastGuiW, AbsoulteSolution.ini, Gui, guiW, 500
SysGet, VirtualW, 78
SysGet, VirtualH, 79
If (LastGuiX <= 0) Or (LastGuiX >= VirtualW )
  LastGuiX = Center
If (LastGuiY <= 0) Or (LastGuiY >= VirtualH )
  LastGuiY = Center

; ------ Gui
Gui, +Resize -Maximize +MinSize500x400
TabH := LastGuiH - 15
TabW := LastGuiW - 13
ListViewH := LastGuiH - 130
ListViewW := LastGuiW - 30
Gui, Add, Tab, x7 y7 vTabName w%TabW% h%TabH%, Mine|Watch|Table Groups

;Mine Tab
Gui, Tab, Mine
Gui, Add, Text, xp+8 yp+30 w250 vHandsSavedDisplay, Hands Saved: 0
Gui, Add, ListView, xp yp+15 w%ListViewW% h%ListViewH% Sort vTheListView, Hand Number|Winner|Pot ($)|Table
LV_ModifyCol(3, "Float Left")
;LV_ModifyCol(4, 0)
GapAfterListView := ListViewH + 10
CenterX := ListViewW/2 - 62
Gui, Add, CheckBox, xp+%CenterX% yp+%GapAfterListView% vOnlyObservedHands, Only Observed Hands
Gui, Add, Button, xp-35 yp+30 w70 Hidden, Stop
Gui, Add, Button, xp yp w70 , Start
Gui, Add, Button, xp+80 yp , Force Scan
Gui, Add, Button, xp+85 yp w70 gExit, Close

;Watch Tab
Gui, Tab, Watch
Gui, Add, Text, x15 y37 w35 vtxt_tables, Tables:
Gui, Add, ListView, xp yp+19 w323 h306 Sort +LV0x1 vlv_TableList , Priority|Table|Game|Limit|Players|Client|LastHand
LV_ModifyCol(7,0)
Gui, Add, Text, xp+338 yp-19 w34 vtxt_clients, Clients:
Gui, Add, ListView, xp yp+19 w131 h229 Sort +LV0x1 vlv_ClientList, Client|User Name|Machine|Tables
Gui, Add, Button, xp+3 yp+240 w30 vgui_gobutton w30 ,Go
Gui, Add, Button, xp+37 yp-1 w30 vgui_stopbutton w30 , Stop
Gui, Add, Text, xp-37 yp+30 w100 vTableScanTime, Last Scan at:

;Table Groups Tab
Gui, Tab, Table Groups
Gui, Add, Text, x15 y37 w31  vtext_game, Game:
Gui, Add, DropDownList, xp yp+19 Vwhich_game ,
( Join
Limit Hold'em|No-Limit Hold'em|Pot-Limit Hold'em|Omaha|Omaha Hi-Lo|No-Limit Omaha Hi-Lo|Pot-Limit Omaha|Pot-Limit Omaha Hi-Lo|7 Card Stud|7 Stud Hi-Lo|Razz
|SNG (NL Hold'em)|SNG (Limit Hold'em)|SNG (Omaha)|SNG (Omaha H/L)|SNG (PL Omaha)|SNG (PL Omaha H/L)|SNG (7 Stud)|SNG (7 Stud H/L)|SNG (Razz)
)
Gui, Add, Text, xp+130 yp-19 w24 , Limit:
Gui, Add, DropDownList, xp yp+19 vwhich_limit ,
Gui, Add, Text, xp+130 yp-19 w57 vmin_players_txt, Min Players:
Gui, Add, DropDownList, xp yp+19 vplayers_min w40 , 2|3|4|5|6|7|8|9
Gui, Add, Text, xp+67 yp-19 w54 vtables_tops_txt, Max tables:
Gui, Add, DropDownList, xp yp+19 vtables_tops w40 , ---|1|2|3|4|5|6|7|8|9|10
Gui, Add, Text, xp+68 yp-19 w65 vmin_pot_txt, Min. avg. pot:
Gui, Add, Edit, xp yp+19 w30 vmin_pot w30 r1 Number
Gui, Add, Radio, xp-395 yp+31 w36 vgui_typebox Checked , Full
Gui, Add, Radio, xp+51 yp w45 h13 vgui_typebox2 , 6max
Gui, Add, ListView, xp-50 yp+31 w460 h38 vListViewEdit LV0x8000 NoSortHdr Grid , Priority|Game|6max/Full|Limit|Players|Tables|Pot
Gui, Add, ListView, xp yp+48 w460 h200 vListViewPrefs -Hdr -LV0x4 Sort Grid , Priority|Game|6max/Full|Limit|Players|Tables|Pot
LV_ModifyCol(1, "Integer")
;Disable the stop button at startup.
GuiControl, Disable, gui_stopbutton
Gui, Show, x%LastGuiX% y%LastGuiY% w%LastGuiW% h%LastGuiH%, The Absolute Solution (Client %this_client%)
Critical, Off
Return

; ------ Menu & Tray Subroutines
l_reload:
Reload
return
l_listvars:
ListVars
Pause
return
Exit:
GuiClose:
Critical, On
WinGetPos, LastGuiX, LastGuiY, , , The Absolute Solution ahk_class AutoHotkeyGUI
IniWrite, %LastGuiX%, AbsoulteSolution.ini, Gui, guiX
IniWrite, %LastGuiY%, AbsoulteSolution.ini, Gui, guiY
IniWrite, %LastGuiH%, AbsoulteSolution.ini, Gui, guiH
IniWrite, %LastGuiW%, AbsoulteSolution.ini, Gui, guiW
ExitApp
Return
; ------ Other Gui Subroutines
GuiSize:

Anchor("TheListView", "wh")
Anchor("OnlyObservedHands", "y")
Anchor("Stop", "y")
Anchor("Start", "y")
Anchor("Force Scan", "y")
Anchor("Close", "y")
Anchor("TabName", "wh")
Anchor("lv_TableList", "wh")
Anchor("lv_ClientList", "xh")
Anchor("gui_gobutton", "xy")
Anchor("gui_stopbutton", "xy")
Anchor("TableScanTime", "xy")
Anchor("txt_clients", "x")
Anchor("ListViewEdit", "w")
Anchor("ListViewPrefs", "wh")
GuiControlGet, txt_tables, Pos

Gui, ListView, lv_TableList  ; Adjust Listview Col Width
LV_ModifyCol(1, ((A_GuiWidth - txt_tablesX)/1.5)/12)
LV_ModifyCol(2, ((A_GuiWidth - txt_tablesX)/1.5)/4)
LV_ModifyCol(3, ((A_GuiWidth - txt_tablesX)/1.5)/3.5)
LV_ModifyCol(4, ((A_GuiWidth - txt_tablesX)/1.5)/6)
LV_ModifyCol(5, ((A_GuiWidth - txt_tablesX)/1.5)/12)
LV_ModifyCol(6, ((A_GuiWidth - txt_tablesX)/1.5)/12)

Gui, ListView, lv_ClientList
LV_ModifyCol(1, ((A_GuiWidth - txt_tablesX)/3 - 1.25*8*2)/6)
LV_ModifyCol(2, ((A_GuiWidth - txt_tablesX)/3 - 1.25*8*2)/6*3)
LV_ModifyCol(3, 0)
LV_ModifyCol(4, ((A_GuiWidth - txt_tablesX)/3 - 1.25*8*2)/6)

Gui, ListView, ListViewEdit
LV_ModifyCol(1, (A_GuiWidth - 40)/20)
LV_ModifyCol(2, (A_GuiWidth - 40)/3)
LV_ModifyCol(3, (A_GuiWidth - 40)/7)
LV_ModifyCol(4, (A_GuiWidth - 40)/6)
LV_ModifyCol(5, (A_GuiWidth - 40)/10)
LV_ModifyCol(6, (A_GuiWidth - 40)/12)
LV_ModifyCol(7, (A_GuiWidth - 40)/10)

Gui, ListView, ListViewPrefs
LV_ModifyCol(1, (A_GuiWidth - 40)/20)
LV_ModifyCol(2, (A_GuiWidth - 40)/3)
LV_ModifyCol(3, (A_GuiWidth - 40)/7)
LV_ModifyCol(4, (A_GuiWidth - 40)/6)
LV_ModifyCol(5, (A_GuiWidth - 40)/10)
LV_ModifyCol(6, (A_GuiWidth - 40)/12)
LV_ModifyCol(7, (A_GuiWidth - 40)/10)

Gui, ListView, TheListview
LV_ModifyCol(1, (A_GuiWidth - 38)/6)
LV_ModifyCol(2, (A_GuiWidth - 38)/3)
LV_ModifyCol(3, (A_GuiWidth - 38)/6)
LV_ModifyCol(4, (A_GuiWidth - 38)/3)

LastGuiH = %A_GuiHeight%
LastGuiW = %A_GuiWidth%
Return

Anchor(cl, a = "", r = false) {
   static d, g, sd = 12, sg := 13, sc = 0, k = 0xffff, iz = 0, bx, by
   If !iz
      iz := 1, VarSetCapacity(g, sg * 99, 0), VarSetCapacity(d, sd * 200, 0)
   Gui, %A_Gui%:+LastFound
   If cl is xdigit
      c = %cl%
   Else {
      GuiControlGet, c, Hwnd, %cl%
      If ErrorLevel
         ControlGet, c, Hwnd, , %cl%
   }
   If !(A_Gui or c) and a
      Return
   cg := (A_Gui - 1) * sg
   Loop, %sc%
      If NumGet(d, z := (A_Index - 1) * sd) = c {
         p := NumGet(d, z + 4, "UInt64"), l := 1
            , x := p >> 48, y := p >> 32 & k, w := p >> 16 & k, h := p & k
            , gw := (gh := NumGet(g, cg + 1)) >> 16, gh &= k
         If a =
            Break
         Loop, Parse, a, xywh
            If A_Index > 1
            {
               v := SubStr(a, l, 1)
               If v in y,h
                  n := A_GuiHeight - gh
               Else n := A_GuiWidth - gw
               b = %A_LoopField%
               %v% += n * (b + 0 ? b : 1), l += StrLen(A_LoopField) + 1
            }
            DllCall("SetWindowPos", "UInt", c, "Int", 0
               , "Int", x, "Int", y, "Int", w, "Int", h, "Int", 4)
            If r
               VarSetCapacity(rc, 16, 0), NumPut(x, rc, 0, "Int"), NumPut(y, rc, 4, "Int")
                  , NumPut(w + x, rc, 8, "Int"), NumPut(h + y, rc, 12, "Int")
                  , DllCall("InvalidateRect", "UInt", WinExist(), "UInt", &rc, "UInt", true)
            Return
      }
   ControlGetPos, x, y, w, h, , ahk_id %c%
   If !p {
      If NumGet(g, cg, "UChar") != A_Gui {
         WinGetPos, , , , gh
         gh -= A_GuiHeight
         VarSetCapacity(bdr, 63, 0)
            , DllCall("GetWindowInfo", "UInt", WinExist(), "UInt", &bdr)
            , NumPut(A_Gui, g, cg, "UChar")
            , NumPut(A_GuiWidth << 16 | A_GuiHeight, g, cg + 1, "UInt")
            ,  NumPut((bx := NumGet(bdr, 48)) << 32
            | (by := gh - NumGet(bdr, 52)), g, cg + 5, "UInt64")
      }
      Else b := NumGet(g, cg + 5, "UInt64"), bx := b >> 32, by := b & 0xffffffff
   }
   s := x - bx << 48 | y - by << 32 | w << 16 | h
   If p
      NumPut(s, d, z + 4, "UInt64")
   Else NumPut(c, d, sc * 12), NumPut(s, d, sc * 12 + 4, "UInt64"), sc++
}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 172 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: gemisigo, reesd, RoAltmann and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group