Sign in to follow this  
Followers 0
Aktonius

Something is driving me nuts about Koda

9 posts in this topic

#1 ·  Posted (edited)

So from the start, this is how Koda code generation works...

#Region ### START Koda GUI section ### Form=form.kxf
code generated and designed by koda with "update script" function
#EndRegion ### END Koda GUI section ###

Now if for example i use an UDF which can create special sort of controls like(colorpicker) by Yashied and if i want to insert it in my gui(made by Koda) i do something like. Please notice the nesting(which is source of my issue here, will explain later)

#Region ### START Koda GUI section ### Form=form.kxf
code generated and designed by koda with "update script" function
<maintab>
 <tab1>
    GUICtrlCreateGroup("group", W, H, 1, 1)
    $useframe = GUICtrlCreateCheckbox("Use Colored Frame", 656, 288, 113, 17)
    $Label23 = GUICtrlCreateLabel("Frame Thickness", 648, 320, 85, 17)
    $framethickness = GUICtrlCreateInput("5", 744, 318, 25, 21)
    $colorlabel = GUICtrlCreateLabel("", 744, 354, 25, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
 </tab1>

 <tab2>
 </tab2>
</maintab>
#EndRegion ### END Koda GUI section ###

Each time i load Koda designer, modify something and update script, it will devastate this code. Is there any way to avoid this?

What i tried is this...

#Region ### START Koda GUI section ### Form=form.kxf
code generated and designed by koda with "update script" function
#EndRegion ### END Koda GUI section ###
GUICtrlCreateGroup("group", W, H, 1, 1)
$useframe = GUICtrlCreateCheckbox("Use Colored Frame", 656, 288, 113, 17)
$Label23 = GUICtrlCreateLabel("Frame Thickness", 648, 320, 85, 17)
$framethickness = GUICtrlCreateInput("5", 744, 318, 25, 21)
$colorlabel = GUICtrlCreateLabel("", 744, 354, 25, 21)
;$picker = GUICtrlCreateButton("picker", 656, 352, 75, 25, $WS_GROUP)
;$picker = _GUIColorPicker_Create('Color...', 656, 352, 75, 25, 0xFF6600, BitOR($CP_FLAG_DEFAULT, $CP_FLAG_TIP))
$picker = _GUIColorPicker_Create('Color...', 656, 352, 75, 25, 0xff0000, BitOR($CP_FLAG_DEFAULT, $CP_FLAG_TIP))
GUICtrlSetBkColor($colorlabel, _GUIColorPicker_GetColor($picker))
GUICtrlCreateGroup("", -99, -99, 1, 1)

which results in massive fail because this controlgroup is now not nested in the proper tabsheet(like shown in previous example)

So i am thinking is it at least something like

#Region ### START Koda GUI section ### Form=form.kxf

#region off

my code nested properly and this code will be ignored by koda

region on

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

So my goal is to simply be able to insert a code there manually and with Koda as well(when i need it) and hopefully Koda will not eat my manual code if this is even possible? Also again please notice that i can not just make my code after the end of region because then it will not be nested in my tabsheet(which is generated in koda region)

Thank you in advance

Edited by Aktonius

Share this post


Link to post
Share on other sites



If you make those areas into regions and use the Beta of Tidy then Tidy will indent nested regions.

You can either add this to the Tidy.ini file

*** Indent #region sections
region_indent=1

Or you can add one or the other of these directives in your script.

#Tidy_Parameters=/ri

or

#Tidy_Parameters=/region_indent

That will give you an output of something like

#Region ## Koda Region
    #Region ## Tab Control
        #Region ## Tab Item 1
        #EndRegion ## Tab Item 1

        #Region ## Tab Item 2
        #EndRegion TabItem 2
    #EndRegion ## Tab Control
#EndRegion ## Koda Region

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I am sorry but i don't understand how will this make Koda ignore the code that i insert in only tabitem1 region while updating everything else with "update script"?

Actually i would still love my tab1item to remain updated by Koda except that single item that i insert. Maybe iam asking to much? But still i have to ask.

Edited by Aktonius

Share this post


Link to post
Share on other sites

I think I misunderstood your request the first time.

You can't just randomly sprinkle GUI code throutht the script. If you insist on using Koda then all of the GUI code has to be in it's proper place in the Koda region. Just because that region is auto generated doesn't imply that you can't manually make changes within it. After all it's straight up AutoIt GUI code no matter what you used to create it. There are a lot of us around that don't use Koda at all, we simply write the code on the fly.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I am sorry but i don't understand how will this make Koda ignore the code that i insert in only tabitem1 region while updating everything else with "update script"?

Actually i would still love my tab1item to remain updated by Koda except that single item that i insert. Maybe iam asking to much? But still i have to ask.

As far as I understand your problem, you are trying to add controls to a tab sheet after the tab is created by the Koda code, but you are not specifying that the controls should be in the tab. You need to use

GuiSwitch($Gui,$Tab2);specify the parent for the controls
GUICtrlCreateGroup("group",.........

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

As far as I understand your problem, you are trying to add controls to a tab sheet after the tab is created by the Koda code, but you are not specifying that the controls should be in the tab. You need to use

GuiSwitch($Gui,$Tab2);specify the parent for the controls
GUICtrlCreateGroup("group",.........

I tried to search parent, nesting etc.. etc.. but i could not find this. Thanks a bunch

Share this post


Link to post
Share on other sites

i'm one of those people who don't use KODA at all, good for getting a handle on GUIs but i prefer to make it myself instead of have it generated.

Share this post


Link to post
Share on other sites

I'm so encouraged that Chimaera and CodyBarret were able to break their silence and start talking about their problems in this frank and honest 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