Sign in to follow this  
Followers 0
Mixam

Some Koda form designer help Please

7 posts in this topic

#1 ·  Posted (edited)

I'm using koda form designer to make a gui and I and to use an iniread to fill out the default for the input box. At the moment all I can think of is editing it manually after making the form. it automatically puts whatever you put in the text field in " " when making the form. I thought maybe putting --"iniread(blah blah)"-- in the text field then just doing a find replace on the form output and replacing "--" with nothing to save me some time, but there has to be a better way.

Right now its a heck of a pain in the butt to manually edit the form every time I make a change to the gui. Using find replace will speed it up a bit, but there still should be a better way to put non text stuff into an input box setting that will return a text value. I'm just hoping one of you knows a way around this so I don't have to edit manually every time I make a small change to the gui, like adding a button

Edited by Mixam

Share this post


Link to post
Share on other sites



Ok I figured it out a bit. If i put in the text spot " & iniRead(blah) & " it works. But I have a variable in my ini read which isn't declared in the form. Is there any way for me to declare a variable in the form, or have the form use a variable from the .au3 file I want to add the gui too?

To be exact this is what I'm now using in the text box of the input box:

" & IniRead($thisprogram & ".ini", "Settings", "Sleep", 1000) & "

This doesn't work because $thisprogram is not declared

If I switch it to this

" & IniRead("MixamAO.ini", "Settings", "Sleep", 1000) & "

it works

So how can i get the form to ignore that variable, or declare that variable, or use the declaration for the variable from a .au3 file?

Share this post


Link to post
Share on other sites

Ok I figured it out a bit. If i put in the text spot " & iniRead(blah) & " it works. But I have a variable in my ini read which isn't declared in the form. Is there any way for me to declare a variable in the form, or have the form use a variable from the .au3 file I want to add the gui too?

To be exact this is what I'm now using in the text box of the input box:

" & IniRead($thisprogram & ".ini", "Settings", "Sleep", 1000) & "

This doesn't work because $thisprogram is not declared

If I switch it to this

" & IniRead("MixamAO.ini", "Settings", "Sleep", 1000) & "

it works

So how can i get the form to ignore that variable, or declare that variable, or use the declaration for the variable from a .au3 file?

I wouldn't expect that an inputbox was part of the gui design done with Koda. If you mean an input, then you can create it in Koda with any text or no text, then in your script set the text you want with GuiCtrlSetData. But maybe I have not understood.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Well I'm trying to make the gui read the value from the ini file for each setting, then be able to modify it and save it. I already got the program running so you modify the ini file to your liking before running the program. But there are alot of stupid people out there, so I'm making a gui for them so I get less people asking me for help setting it up. I'm still very new to coding and I jsut figured out I could use ' ' or " " and it did the same thing. So I can go " & 'iniread(blah)' & " and then just remove the "" & ' and the ' & "" when i paste it into my program. I was however hoping that I could include my programs code with the gui so that it would have the variable declared and would actually work right.

As is now, I have to save my gui to a .kxf file then when I'm done editing it copy the code to clipboard then into my program. Then I have to edit it all to read each line of the ini files into the input boxes. Then if i need to make a small change in the gui later, I have to copy paste and edit the inireads all back in again It just seems like there should be a better way. If there is not, I can plug away at it, I'm just hoping there is a better way.

Share this post


Link to post
Share on other sites

Well I'm trying to make the gui read the value from the ini file for each setting, then be able to modify it and save it. I already got the program running so you modify the ini file to your liking before running the program. But there are alot of stupid people out there, so I'm making a gui for them so I get less people asking me for help setting it up. I'm still very new to coding and I jsut figured out I could use ' ' or " " and it did the same thing. So I can go " & 'iniread(blah)' & " and then just remove the "" & ' and the ' & "" when i paste it into my program. I was however hoping that I could include my programs code with the gui so that it would have the variable declared and would actually work right.

As is now, I have to save my gui to a .kxf file then when I'm done editing it copy the code to clipboard then into my program. Then I have to edit it all to read each line of the ini files into the input boxes. Then if i need to make a small change in the gui later, I have to copy paste and edit the inireads all back in again It just seems like there should be a better way. If there is not, I can plug away at it, I'm just hoping there is a better way.

If you have designed your gui with Koda and got a working script then you shouldn't have to change your script manually ever again if you change something in the gui design with Koda because there is an option to update the script.

Make sure you save the kxf file and the .au3 file in the same folder.

When the code is generated by Koda it has the gui design enclosed between #region lines. The first #region line includes the path to the script. For a new design the line will be

#Region ### START Koda GUI section ### Form=

So add the full path to the kxf file here manually. Save the design and close it. Make sure the au3 file is saved with the #region lines around the design with the full path to the kxf file, and in the same folder as the kxf file. Open the kxf file design file again and in the Tools menu you should see that there is an option Update Script. Now any change you make in the design can be saved automatically in the script by choosing Update.

When Koda opens the kxf form it reads all the au3 scripts in the same folder to see if any of them have the #region line which refers to the kxf file. If it finds just one au3 file then it assumes that is the one to use. If it finds more than one au3 file it shows you a list and asks you which one to use. Then, if you modify the design in Koda and choose Update it will change just the gui design part in the au3 file between the #region lines and leave the rest of the script alone.

Setting what you want in the edits should be done in your script after the gui design section, that's not Koda's job. You need to rethink the way you have constructed your script because you are doing it in a very difficult and tedious way.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I already had the path to the .kxf file where you said. I moved them all into their own folder and I still can't get update to show up in tools. Maybe I've changed too much manually for it to recognize it, I do not know. If using update changes all the script code in between the comments, then I might as well just copy and paste. If using update only changes what you just changed, then it would be useful to me.

As for the "difficult and tedious" way of doing it, this is my first gui and I'm learning it all as I go. I'm not surprised I have to keep going back to change things because when I start out I don't know its not going to work the way I want it to. For instance I made all my buttons, then tried to put them in groups, which was a disaster. I would appreciate it if instead of telling me I'm doing it the dumb way you point me in the direction of the better way.

Thank you for your help

Edit: Should I be never touching the form code? Is it possible for me to just reasign values for input boxes or checkboxes or whatever other types of controle from outside of the koda form code?

#Region ### START Koda GUI section ### Form=

Is it possible to never touch the stuff in here, but still change all the values to whatever I want? Because that would be better for me I think.

#EndRegion ### END Koda GUI section ###

Edited by Mixam

Share this post


Link to post
Share on other sites

I already had the path to the .kxf file where you said. I moved them all into their own folder and I still can't get update to show up in tools. Maybe I've changed too much manually for it to recognize it, I do not know. If using update changes all the script code in between the comments, then I might as well just copy and paste. If using update only changes what you just changed, then it would be useful to me.

Something isn't right. Did you follow my instructions?

As for the "difficult and tedious" way of doing it, this is my first gui and I'm learning it all as I go. I'm not surprised I have to keep going back to change things because when I start out I don't know its not going to work the way I want it to. For instance I made all my buttons, then tried to put them in groups, which was a disaster. I would appreciate it if instead of telling me I'm doing it the dumb way you point me in the direction of the better way.

I did not say "dumb" anything. Digging a hole in the road if difficult and tedious but it isn't dumb for example. I said that what you were doing was difficult and tedious by way of indicating that life could be much easier. It was meant more as an encouragement to change than a criticism and if you took it that way then my apologies for my clumsiness.

I don't understand what you mean by saying "..instead of .. better way." when the bulk of my post to you was a lengthy description of what to do. I don't think I can spell it out any more clearly without you giving more information about what the #region line says, what the end #region line says and what the full path to your script is.

Thank you for your help

That's fine if not a little confusing.

Edit: Should I be never touching the form code? Is it possible for me to just reasign values for input boxes or checkboxes or whatever other types of controle from outside of the koda form code?

#Region ### START Koda GUI section ### Form=

Is it possible to never touch the stuff in here, but still change all the values to whatever I want? Because that would be better for me I think.

#EndRegion ### END Koda GUI section ###

That's what I've been telling you and it's not clear to me how what I said can be misinterpreted.

Here is what I first said

I wouldn't expect that an inputbox was part of the gui design done with Koda. If you mean an input, then you can create it in Koda with any text or no text, then in your script set the text you want with GuiCtrlSetData. But maybe I have not understood.

Here is my second comment about the same thing.

Setting what you want in the edits should be done in your script after the gui design section, that's not Koda's job. You need to rethink the way you have constructed your script because you are doing it in a very difficult and tedious way.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


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
Sign in to follow this  
Followers 0