Jump to content

Recommended Posts

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. :whistle:

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

Not enough info/code to find/fix the error

8)

Edited by Valuater

NEWHeader1.png

Link to post
Share on other sites
  • Replies 111
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Moderators

Is it time to cut the umbilical cord?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites

Is it time to cut the umbilical cord?

@SmOke_N

Well if I had been using autoit for the last few years straight maybe, but isn't that why the rest of us are here. My scripting/programming experience started with AutoIt and it's done well. I haven't done other languages or scripting like VBS or anything and have used AutoIt for a vast amount of scripts. So how are we going to learn more if there aren't resources or other experts in something to share knowledge. I don't recall seeing an autoit guide. The help file is great but only for syntax purposes, so for more complex things what do you suggest??

@Valuater

Anyway, are you able to use a stringsplit() in that type of syntax? When I have it output to a message box it shows up blank, but the file is there and it can do an inireadsection fine otherwise. I just wasn't quite sure how to have it read the key/value and spit out the checkboxes according to what it finds in the section.

EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites

My script is going well. I have used the input from several other individuals. I really appreciate your help. The question Valuater is, when dynamically assigning ControlID's to each checkbox, how do I run the installer for them determining which is checked. AKA This is my Settings tab, maybe looking at the code will help.

;|============|
;|Settings Tab|
;|============|
GUICtrlCreateTabItem("Settings")
Dim $Settings = StringSplit("Add Domain Users,Classic Start Menu,Classic Windows Theme,Disable Auto Updates,Disable Firewall,Disable Print Balloon," & _
        "Icon Cleanup,Internet Explorer Settings,Power Settings(Laptop),Power Settings(PC),Remove Windows Messenger", ",")
        
        Dim $SettCkecked = StringSplit("1,1,1,1,1,1,1,1,0,0,1", ",") ; 1 =checked

Dim $SettCtrl[ ($Settings[0] + 1) ]

;Create Checkbox
Local $nLeft = 25, $nTop = 125, $nWidth = 200, $nHeight = 20
For $x = 1 To $Settings[0]
    $SettCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20) ;-1, 0, -1, -1)
    If $SettCkecked[$x] == 1 Then GUICtrlSetState( -1, $GUI_CHECKED)
    $XSkinID[$x] = GUICtrlCreateLabel($Settings[$x], $nleft +20, $nTop + 3, $nWidth, $nHeight)
    $nTop += 22
Next

I used to do it the long way, saying $controlID01 = yadda yadda yadda, "Add Domain Users", yadda, yadda

Then, I would check the status of that particular control handle, then run the "Add Domain Users Function" I would have a seperate "Control" check for each control. You get what I am saying?

Link to post
Share on other sites

Here is what I have so far

Posted Image

Edit: Question, how do I change the button color?

Are you using an external file or putting the checkbox names inside the code? If you are still doing that you will still have to edit the code everything you want to add another box. I've been trying to use an ini file instead but haven't been able to get it to read it using the same code Valuater posted.

EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites

My script is going well. I have used the input from several other individuals. I really appreciate your help. The question Valuater is, when dynamically assigning ControlID's to each checkbox, how do I run the installer for them determining which is checked. AKA This is my Settings tab, maybe looking at the code will help.

;|============|
;|Settings Tab|
;|============|
GUICtrlCreateTabItem("Settings")
Dim $Settings = StringSplit("Add Domain Users,Classic Start Menu,Classic Windows Theme,Disable Auto Updates,Disable Firewall,Disable Print Balloon," & _
        "Icon Cleanup,Internet Explorer Settings,Power Settings(Laptop),Power Settings(PC),Remove Windows Messenger", ",")
        
        Dim $SettCkecked = StringSplit("1,1,1,1,1,1,1,1,0,0,1", ",") ; 1 =checked

Dim $SettCtrl[ ($Settings[0] + 1) ]

;Create Checkbox
Local $nLeft = 25, $nTop = 125, $nWidth = 200, $nHeight = 20
For $x = 1 To $Settings[0]
    $SettCtrl[$x] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20) ;-1, 0, -1, -1)
    If $SettCkecked[$x] == 1 Then GUICtrlSetState( -1, $GUI_CHECKED)
    $XSkinID[$x] = GUICtrlCreateLabel($Settings[$x], $nleft +20, $nTop + 3, $nWidth, $nHeight)
    $nTop += 22
NextoÝ÷ جyÛhv­¶¥¢x0k+Ê)àÓ~¢{k¢RÓ

8)

you guys need to read the script examples i have already given..

NEWHeader1.png

Link to post
Share on other sites

as previously stated...here

http://www.autoitscript.com/forum/index.ph...st&p=315460

For $x = 1 To $Programs[0]
    If gui control read "check box" = $GUI_CHECKED Then ; assuming you know how to read a checkbox
        If FileExists($Programs[$x] Then
            RunWait($Programs[$x]
        Else
            Call($Programs[$x]) ; or call a function
        EndIf
    EndIf
Next

8)

you guys need to read the script examples i have already given..

@Valuater

I have but I'm still getting the error I sent you when trying to have it read from the ini file instead of the stringsplit() method by itself. Any insight to what I was doing wrong on that part?

Edit:

I got the tabs to work but from the ini file but its the checkboxes still aren't working using the dynamic method if I try to read from the ini file.

Edited by EndFunc
EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites

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. :whistle:

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
I need to see all the code... all the code... all the code... got it???

this while loop will never work... the code is too much of a mess to help you

8)

NEWHeader1.png

Link to post
Share on other sites

I need to see all the code... all the code... all the code... got it???

this while loop will never work... the code is too much of a mess to help you

8)

I gave you pretty much all the code. Here is what I used. This is what you had and I just replaced the $Programs with the path to the ini file.

So what do I need to do differently then to read from the file and not the stringsplit??

;Programs Tab
$GUI=GUICreate ("Program",800,700)
GUISetFont(10,500)
GUISetBkColor(0x006666CC)
GUICtrlCreateTab (145,70,643,470)
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
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
EndSwitch
WEnd
EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites
  • Moderators

@SmOke_N

Well if I had been using autoit for the last few years straight maybe, but isn't that why the rest of us are here. My scripting/programming experience started with AutoIt and it's done well. I haven't done other languages or scripting like VBS or anything and have used AutoIt for a vast amount of scripts. So how are we going to learn more if there aren't resources or other experts in something to share knowledge. I don't recall seeing an autoit guide. The help file is great but only for syntax purposes, so for more complex things what do you suggest??

I have no idea if you are speaking for yourself or for people in general. I obviously have seen you make an effort, and to be honest, hadn't paid any attention to your specific posts in this thread, my reference was to the OP.

So let me answer your question directly... How can you "learn"? By doing... and not always have others doing for you. I've seen the OP ask many questions here in the "Hold my hand through every step of my project" type of way... that's not learning in my opinion, and yes, it's my opinion.

You've demonstrated you have ability, so if you feel like what I said was toward you, you are mistaken, if you're just defending the others, then you have my answer.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites

I have no idea if you are speaking for yourself or for people in general. I obviously have seen you make an effort, and to be honest, hadn't paid any attention to your specific posts in this thread, my reference was to the OP.

So let me answer your question directly... How can you "learn"? By doing... and not always have others doing for you. I've seen the OP ask many questions here in the "Hold my hand through every step of my project" type of way... that's not learning in my opinion, and yes, it's my opinion.

You've demonstrated you have ability, so if you feel like what I said was toward you, you are mistaken, if you're just defending the others, then you have my answer.

Well it wasn't specific so I do apologize I was mistaken and thought it was towards me. I am just here to learn and help myself. No prob :whistle:

EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites

one more question, oh great one. I was changing the look of one of the skins. Fantastic by the way. Changed the color, and changed the amount of white space. However. The white space isn't lining up properly for some reason. Here are the images for the skin.

Skin.zip

Link to post
Share on other sites

one more question, oh great one. I was changing the look of one of the skins. Fantastic by the way. Changed the color, and changed the amount of white space. However. The white space isn't lining up properly for some reason. Here are the images for the skin.

Why does every "inch" seems to be an effort??

Why is there no Skin.dat file??

Why do i need to ask for one??

Did we not talk about this file before???

...Why not use a pre-designed skin 1 out of 1000+ ????????

8)

NEWHeader1.png

Link to post
Share on other sites

Why does every "inch" seems to be an effort??

Why is there no Skin.dat file??

Why do i need to ask for one??

Did we not talk about this file before???

...Why not use a pre-designed skin 1 out of 1000+ ????????

8)

As for my previous question, I just need to see how I can get it to read from the ini file instead of stringsplit() you have in the code below. You showed me for the tabs which works fine but I can't get that to work for the code below. Once I have it I will try and put it all together.

Thanks!!!

CODE: AutoIt;Programs Tab
$GUI=GUICreate ("Program",800,700)
GUISetFont(10,500)
GUISetBkColor(0x006666CC)
GUICtrlCreateTab (145,70,643,470)
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
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
EndSwitch
WEnd
EndFuncAutoIt is the shiznit. I love it.
Link to post
Share on other sites

I ask a ton of questions, this I know. However I will do my best to share with everyone. Here is what I have come up with. You guys rock, and I used code that was provided to me by Valuater, and tried to make it somewhat my own, and fit for my needs. This is a little snippet of me dynamically creating checkboxes.

;|===========|
;Programs Tab|
;|===========|
GUICtrlCreateTabItem("Programs")

Dim $aPrograms[13][3] = [ _
                ['Appointments Pro OPR','InstallApptsProOPR()','0'], _
                ['Appointments Pro OPSS','InstallApptsProOPSS()','0'], _
                ['Care Manager ' & $CareManagerVersion,'InstallCareManager()','0'], _
                ['ds.Pathfinder','InstalldsPathfinder()','0'], _
                ['HES','InstallHES()','0'], _
                ['HPF Workstation','InstallHPF()','0'], _
                ['LaserArc','_LaserArcInstall()','0'], _
                ['ReDoc','_InstallRedoc()','0'], _
                ['ReportXpress','InstallReportXpress()','0'], _
                ['Softmed','_SSIinstall()','0'], _
                ['Star Navigator ' & $StarNavigatorVersion,'InstallStar()','0'], _
                ['Tsystem (Laptop)','InstallTsystemLaptop()','0'], _
                ['Tsystem (PC)','InstallTsystemPC()','0'] _
            ]

Dim $aProgramsSize = Ubound($aPrograms)
Dim $progXSkinID[ ($aProgramsSize + 1) ]
Dim $ProgCtrl[ ($aProgramsSize + 1) ]


;Create Checkbox
Local $nLeft = 25, $nTop = 125, $nWidth = 150, $nHeight = 20
For $i = 1 To $aProgramsSize - 1
    $ProgCtrl[$i] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 20, 20);-1, 0, -1, -1)
    If $aPrograms[$i][2] == 1 Then GUICtrlSetState( -1, $GUI_CHECKED)
    $progXSkinID[$i] = GUICtrlCreateLabel($aPrograms[$i][0], $nLeft + 20, $nTop + 3, $nWidth, $nHeight)
    $nTop += 22
Next

;Create Buttons
$install = XSkinButton ('Start', 230, 260, 75, 25, 'Install')
$deselect = XSkinButton ('Deselect All', 230, 345, 75, 25, 'DeselectAll_Tab1')
$Sselect = XSkinButton ('Select All', 230, 300, 75, 25, 'SelectAll_Tab1')
$Exit = XSkinButton ( 'Exit', 230, 390, 75, 25, 'Exitier')

See anything I did that you think is dumb? :-), let me know. I will also post a pic of the GUI, made some changes, and rounded the corners of the white space. Pic below:

Posted Image

If anyone is interested in looking at the entire code, let me know. I am more than happy to share!!! And please do let me know if you see anything that you think is.... :whistle:

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...