dufran3 Posted March 7, 2007 Author Share Posted March 7, 2007 Wow, really cool looking GUI. Thanks for the information. That is a good idea. You guessed right, the reason it isn't alphabetic is because I do have to edit source code to add each checkbox. $Ctrl29 = GUICtrlCreateCheckbox('Quick Time', 25, 465, 135, 20) GUICtrlSetState(-1, $GUI_CHECKED)oÝ÷ Ù«¢+Ù%U% ÑɱI ÀÌØí ÑÉ°Èä¤ôÄQ¡¸($%%ÀÌØí-5 ÕôôÄQ¡¸($$%1½¹ÑÉ¥¹Õ¹Ñ¥½¸ ÅÕ½ÐíEÕ¥¬Q¥µÅÕ½Ðì¤($%¹%($%}EÕ¥Q¥µ ¤($%%ÀÌØí-5 ÕôôÄQ¡¸($$%1½á¥Ñ¥¹Õ¹Ñ¥½¸ ÅÕ½ÐíEÕ¥¬Q¥µÅÕ½Ðì¤($%¹%(%¹% It sucks when updating, becuase if I have something that goes before quicktime, or before something, I have to manually add it, and then shift the checkbox down for each item below it. You know what I mean? It is a hassle. Your suggestion is pretty good, and maybe I will just have a "app declare" section at the top or something....not sure yet how I want to do it. Link to comment Share on other sites More sharing options...
Valuater Posted March 7, 2007 Share Posted March 7, 2007 I tried to show you a really good approach when i re-wrote your script... ;Programs Tab GUICtrlCreateTabItem("Programs") Dim $Programs = StringSplit("Appointments Pro OPR,Appointments Pro OPSS,Care Manaager 7.29,ds.Pathfinder,HES,HPF Workstation," & _ "LaserArc,ReDoc,ReportXpress,Softmed,Star Navigator 11.14,Tsystem (Laptop),Tsystem (PC)", ",") Dim $XSkinID[ ($Programs[0] + 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20 For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next that didn't help?? 8) Link to comment Share on other sites More sharing options...
dufran3 Posted March 7, 2007 Author Share Posted March 7, 2007 Oh yes, you did. I wasn't really looking at it. i was getting more frustrated that I could run the .au3, file. I was trying to look at that. Link to comment Share on other sites More sharing options...
EndFunc Posted March 7, 2007 Share Posted March 7, 2007 Oh yes, you did. I wasn't really looking at it. i was getting more frustrated that I could run the .au3, file. I was trying to look at that.Either way I think getting a fresh look from some suggestion I gave and what Valuater sent you, you can problem make it alot easier for yourself now. EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
dufran3 Posted March 8, 2007 Author Share Posted March 8, 2007 (edited) I tried to show you a really good approach when i re-wrote your script... ;Programs Tab GUICtrlCreateTabItem("Programs") Dim $Programs = StringSplit("Appointments Pro OPR,Appointments Pro OPSS,Care Manaager 7.29,ds.Pathfinder,HES,HPF Workstation," & _ "LaserArc,ReDoc,ReportXpress,Softmed,Star Navigator 11.14,Tsystem (Laptop),Tsystem (PC)", ",") Dim $XSkinID[ ($Programs[0] + 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20 For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next oÝ÷ ÚØZµØméióú®¢×~׫$x·*.®gZ+mé¨è§uêmmjG¬ºÚ®W¬±Êy©Ýɨçr©¢ph½è½êÈÁ«!¢§ØZ·*.r¥u©ìÁêÚ}ì*¹ë-ì¶"¯y¦èºØZv¨ºØbH¬¶zËpk+h±ëz»Zxzk-¡·ç$yÖòuçÚº[E¢±1jjex(ºWeGꮢÔ^*ºç$nm¡·ç$yÖòuçÚº[HÂ)emë¬x-+(ǯz¶¥¢Ø^®ÀèÊ)äÜ(ºW[y·¬¶Ú,zÛ(ë(®Ú~V ªê-çhp(^r Would this same method work? It seems as if it will not. My old way, I manually assigned each controlID, then manually checked it...is there a way to do what I was previously doing, using the dynamic assignment? YOU ARE AWESOME MAN! edit: just so you know, I have an included file with my GUI, that has all functions in it for each of my installers. So when that my old check runs, it just runs that function if that specific control is checked. Edited March 8, 2007 by dufran3 Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2007 Share Posted March 9, 2007 ... What do you think is the best way to set certain items to be checked by default?... Do you think it would be best to set some sort of flag? "redoc Check = 1" or something like that? That is what I was thinking, but since I haven't used this "dynamic" way of adding checkboxes, I wasn't really sure..... It Depends.. there are many ways of doing this One way, and maybe the easiest is, just add it in GUICtrlCreateTabItem("Programs") Dim $Programs = StringSplit("Appointments Pro OPR,Appointments Pro OPSS,Care Manaager 7.29,ds.Pathfinder,HES,HPF Workstation," & _ "LaserArc,ReDoc,ReportXpress,Softmed,Star Navigator 11.14,Tsystem (Laptop),Tsystem (PC)", ",") Dim $Ckecked = StringSplit("1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1", ",") ; 1 =checked Dim $XSkinID[ ($Programs[0] + 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20 For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) If $Ckecked[$x] Then GUICtrlSetState( -1, $GUI_CHECKED) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next oÝ÷ Ø è¶«jk¡§!ËhºÇ)â~)^涢&¬Ê¬zØuçÚº[ZÖªºlj÷ªº[ºÛhú+¶®±êí¢Æ¯z¬uë"çç$yÖèÅë*º^© 8) Link to comment Share on other sites More sharing options...
EndFunc Posted March 9, 2007 Share Posted March 9, 2007 (edited) It Depends.. there are many ways of doing this One way, and maybe the easiest is, just add it in GUICtrlCreateTabItem("Programs") Dim $Programs = StringSplit("Appointments Pro OPR,Appointments Pro OPSS,Care Manaager 7.29,ds.Pathfinder,HES,HPF Workstation," & _ "LaserArc,ReDoc,ReportXpress,Softmed,Star Navigator 11.14,Tsystem (Laptop),Tsystem (PC)", ",") Dim $Ckecked = StringSplit("1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1", ",") ; 1 =checked Dim $XSkinID[ ($Programs[0] + 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20 For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) If $Ckecked[$x] Then GUICtrlSetState( -1, $GUI_CHECKED) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next 8) Edit: This is good and mine is not quite as good as yours. Question Valuater, What if you want to use the ini file to actually get the labels/programs for the checkbox instead of having to update the code everytime and just have to add another value in the ini file to dynamically add another chkbox. how could you accomplish that? Edited March 9, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
dufran3 Posted March 9, 2007 Author Share Posted March 9, 2007 GUICtrlCreateTabItem("Programs") Dim $Programs = StringSplit("Appointments Pro OPR,Appointments Pro OPSS,Care Manaager 7.29,ds.Pathfinder,HES,HPF Workstation," & _ "LaserArc,ReDoc,ReportXpress,Softmed,Star Navigator 11.14,Tsystem (Laptop),Tsystem (PC)", ",") Dim $Ckecked = StringSplit("1,1,0,1,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1", ",") ; 1 =checked Dim $XSkinID[ ($Programs[0]+ 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20 For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) If $Ckecked[$x] Then GUICtrlSetState( -1, $GUI_CHECKED) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next Tried this, this is probably the type of method that would work best for me. However I couldn't get it to work right. All the boxes would be checked, and when checking or unchecking items, there would be a little arrow next to the check box, kinda weird. Link to comment Share on other sites More sharing options...
dufran3 Posted March 9, 2007 Author Share Posted March 9, 2007 Changed this line:If $Ckecked[$x] Then GUICtrlSetState( -1, $GUI_CHECKED)oÝ÷ ÚÚ-+ºÚ"µÍY ÌÍÐÚÙXÚÙYÉÌÍÞHOHH[ÕRPÝÙ]Ý]JLK ÌÍÑÕRWÐÒPÒÑQNow the correct checkboxes are being checked. However, getting this weird little error, look at this... Link to comment Share on other sites More sharing options...
_Kurt Posted March 9, 2007 Share Posted March 9, 2007 If you are still looking for suggestions, here are a couple: 1) Font on buttons/labels/etc 2) Organization <= Use Groups with guictrlcreategroup(..) 3) Gradients? Search for GaFrost's UDF & Find 2 nice colors 4) _Control Hover? Search for Valuater's _Control hover & add some effects when mouse is over $control Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
dufran3 Posted March 9, 2007 Author Share Posted March 9, 2007 Thx for the ideas man! Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2007 Share Posted March 9, 2007 Edit: This is good and mine is not quite as good as yours. Question Valuater, What if you want to use the ini file to actually get the labels/programs for the checkbox instead of having to update the code everytime and just have to add another value in the ini file to dynamically add another chkbox. how could you accomplish that? The amount of labels and check boxes are already set to add or remove labels/checkboxes by the amount of programs and setting of the spacing between labels/checkboxes the ini read ideas are like this Dim $Ini_File = @ScriptDir & "\Progran.ini" ; Double array.... Dim $Programs = IniReadSection($Ini_File, "Programs") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $Programs[0][0] MsgBox(4096, "", "Key: " & $Programs[$i][0] & @CRLF & "Value: " & $Programs[$i][1]) Next EndIf ;******************************************************** Or ***************** ; Single array For $x = 1 to IniRead( $Ini_File, "Programs", "key", "0" ) $Programs[$x] = IniRead( $Ini_File, "Programs", $x, "Not Found" ) Next 8) Link to comment Share on other sites More sharing options...
dufran3 Posted March 9, 2007 Author Share Posted March 9, 2007 Any ideas about this? Wow, really cool looking GUI. Thanks for the information. That is a good idea. You guessed right, the reason it isn't alphabetic is because I do have to edit source code to add each checkbox. $Ctrl29 = GUICtrlCreateCheckbox('Quick Time', 25, 465, 135, 20) GUICtrlSetState(-1, $GUI_CHECKED)oÝ÷ Ù«¢+Ù%U% ÑɱI ÀÌØí ÑÉ°Èä¤ôÄQ¡¸($%%ÀÌØí-5 ÕôôÄQ¡¸($$%1½¹ÑÉ¥¹Õ¹Ñ¥½¸ ÅÕ½ÐíEÕ¥¬Q¥µÅÕ½Ðì¤($%¹%($%}EÕ¥Q¥µ ¤($%%ÀÌØí-5 ÕôôÄQ¡¸($$%1½á¥Ñ¥¹Õ¹Ñ¥½¸ ÅÕ½ÐíEÕ¥¬Q¥µÅÕ½Ðì¤($%¹%(%¹% It sucks when updating, becuase if I have something that goes before quicktime, or before something, I have to manually add it, and then shift the checkbox down for each item below it. You know what I mean? It is a hassle. Your suggestion is pretty good, and maybe I will just have a "app declare" section at the top or something....not sure yet how I want to do it. Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2007 Share Posted March 9, 2007 No, and I don't totally understand the Q ... so, how did the other ideas work-out?? 8) Link to comment Share on other sites More sharing options...
EndFunc Posted March 9, 2007 Share Posted March 9, 2007 (edited) No, and I don't totally understand the Q... so, how did the other ideas work-out??8)dufran3: What is the question?Valuater:I am looking over the code to see if I can implement it because I'm not as good at arrays. Now how could you use the ini file to create a tab dynamically based on a new section being added to the ini file. Also how would you get the checkboxes to look at and run the paths to the programs. As always thanks for you help.? Edited March 9, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
Valuater Posted March 10, 2007 Share Posted March 10, 2007 (edited) ... how could you use the ini file to create a tab dynamically based on a new section being added to the ini file. $Section = IniReadSectionNames($Ini_File) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $Section[0] GUICtrlCreateTab($Section[$i] For $x = 1 To IniRead($Ini_File, $Section[$i], "key", "0") $Programs[$x] = IniRead($Ini_File, "Programs", $x, "Not Found") ; gui create checkbox/label for $Program[$x] Next Next EndIf oÝ÷ Ú«¨µéÚ 8) Edited March 10, 2007 by Valuater Link to comment Share on other sites More sharing options...
EndFunc Posted March 10, 2007 Share Posted March 10, 2007 $Section = IniReadSectionNames($Ini_File) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $Section[0] GUICtrlCreateTab($Section[$i] For $x = 1 To IniRead($Ini_File, $Section[$i], "key", "0") $Programs[$x] = IniRead($Ini_File, "Programs", $x, "Not Found") ; gui create checkbox/label for $Program[$x] Next Next EndIf oÝ÷ Ù«¢+Ø()½ÈÀÌØíàôÄQ¼ÀÌØíAɽɵÍlÁt(%Õ¤½¹Ñɽ°ÉÅÕ½Ðí¡¬½àÅÕ½ÐìôÀÌØíU%} ! -Q¡¸(%¥±á¥ÍÑÌ ÀÌØíAɽɵÍlÀÌØíátQ¡¸(IÕ¹]¥Ð ÀÌØíAɽɵÍlÀÌØíát(±Í( ±° ÀÌØíAɽɵÍlÀÌØíát¤(¹%(¹%)9áÐ(( 8) I tried out the dymanic tabs code and in my code it just keeps looping and creating infinate number of tabs with the same name. How do I make it create just say 2 tabs based of off the 2 sections and stop until another is added and so on? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
Valuater Posted March 10, 2007 Share Posted March 10, 2007 I tried out the dymanic tabs code and in my code it just keeps looping and creating infinate number of tabs with the same name. How do I make it create just say 2 tabs based of off the 2 sections and stop until another is added and so on?I dont see code8) Link to comment Share on other sites More sharing options...
jefhal Posted March 10, 2007 Share Posted March 10, 2007 Ideas anyone?One thing that I do to my installation checksheet is to check to see if any of the apps already are installed. If that is true, then I have the check box checked and greyed out. I also put an override button on the form in case I want to re-install the application. They way I check to see if the app already exists is simply to check for an existing *.exe file with the right version.Since a lot of input has gone into your question from others, would you be able to post your code so far so we can all benefit from the results? Thanks! ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
EndFunc Posted March 11, 2007 Share Posted March 11, 2007 (edited) I dont see code 8) I fixed that, I put it in the while loop. But the problem I'm having is getting it to read the ini file for the checkboxes. It gives me constant checkboxes instead of reading the ini file for the entries and creating the boxes based on what's in that particular section of the ini file. Also I don't want the checkboxes to go indefinately in the same column. I would like it to start a new column on the same tab once so many have been created in that particluar column for up to like 4 columns which is about as much space that i've allowed for the tab itself. I know my code is probably a mess but like I mentione before arrays still get me. Dim $Programs = StringSplit(IniReadSection($Ini_File, "Programs"),",") Dim $XSkinID[ ($Programs[0] + 1) ] Dim $ProgCtrl[ ($Programs[0] + 1) ] Local $nLeft = 150, $nTop = 100, $nWidth = 150, $nHeight = 20 GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $nMsg For $x = 1 To $Programs[0] $ProgCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1) $XSkinID[$x] = GUICtrlCreateLabel($Programs[$x], $nLeft + 20, $nTop + 3, $nWidth, $nHeight) $nTop += 22 ; 20, 25 ??? any spacing you want Next Sleep(100) EndSwitch WEnd Edited March 11, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now