Jump to content

Utilising existing GUI code in koda.


Morthawt
 Share

Recommended Posts

I have a program I made long ago for something but I never saved the koda file so it would make it a complete pain for me to visually tweak anything because as far as I am aware, I would have to design an entirely new GUI.

Would it be possible for you guys at AutoIt to add functionality to Koda so that you can take an existing GUI section, with while loop and cases and all and then koda would literally build it ready for tweaking and where existing things still exist and have been tweaked, it would tweak such details and keep all the existing case information and added formatting things that were manually tweaked etc?

This would be really amazing and I feel that other people would benefit from it. I can't be the only person who makes a GUI, doesn't save it and then has no problems making minor tweaks in-code but struggles like hell to go rearranging things perfectly. That is where using a GUI (koda) to make and arrange a GUI you are making, makes everything easy and pleasure to deal with.

tldr;

Example:
A friend gives me his code and wants help. The GUI is just a mess, but trying to do all the alignment and positioning all by digits in code would be a pain. I cannot just hallucinate where everything is based on pixel locations and sizes. So I would take the entire GUI chunk of code, all the form/controls/formatting functions/while loop/switch/case in it's entirety and paste it into an area of Koda and press a button. Koda would then build the GUI on the screen, placing all the controls and formatting them with the instructions that may have been added and keeps the case information as-is. Then when you make your alterations in Koda, you go to export it and it makes an entirely new export that re-makes (from scratch as if you had made this GUI from scratch) all the code for controls, size, placement etc and then also adds all the existing case code back as part of the code you then send (or manually copy/paste as I do) to Scite editor.

Is there any chance this could be implemented? I think this could help a lot of people with their own scripts and others'.

Edited by Morthawt
feature request tag
Link to comment
Share on other sites

2 minutes ago, l3ill said:

Hi Morthawt,

 

Correct me if I misunderstand, Koda has an import function that does this...

You can then save a new kxf file with your new settings.

I forgot all about that. I only ever tried it once back in the ancient past but Koda crashed so I never gave it a thought since. I will give it a try again. Thanks.

Link to comment
Share on other sites

Crashed again

WAMipvo.png

It does not like importing an AutoIt script. My idea is that Koda would import it, build the GUI and take on all the formatting and everything and then preserve everything else like the cases and all the rest of the script, so that you can export it and it would be your same old script just with your tweaked out fixed GUI.

Link to comment
Share on other sites

16 minutes ago, JohnOne said:

It's also possible ISN AutoIt Studio has import functionality.

I thought this was that cool looking (but I think abondoned) Koda replacement someone made with AutoIt it's self. But this I think is not it. Plus I do not see anything in here to do with a GUI. So I am a bit confused.

Link to comment
Share on other sites

1 minute ago, JohnOne said:

It is a complete IDE for AutoIt, and includes a GUI designer, and far from abandoned, where as koda is very much abandoned as far ad I know.

I have looked up and down and I find nothing in there about GUI or forms other than a folder on the right which looks like it is about forms but nothing is in there and the script I am using does have 2 forms in it.

Link to comment
Share on other sites

28 minutes ago, JohnOne said:

It is a complete IDE for AutoIt, and includes a GUI designer, and far from abandoned, where as koda is very much abandoned as far ad I know.

Here is a sample script I made. Originally the gui was inside a function (as the one I am working on is) but that did not work so I commented out the func and I still see no way of seeing any GUI editing capability anywhere in the entire program:

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>



Sleep(3000)
;~ CreateGUI()

;~ Func CreateGUI()
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 148, 81, 192, 124)
    $Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 25)
    $Input1 = GUICtrlCreateInput("Input1", 8, 40, 121, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit

        EndSwitch
    WEnd
;~ EndFunc   ;==>CreateGUI

 

Link to comment
Share on other sites

On 9/13/2016 at 3:42 PM, Morthawt said:

and I still see no way of seeing any GUI editing

<?xml version="1.0" encoding="windows-1251"?>
<object type="TAForm" name="Form1">
	<properties>
		<property name="Left" vt="Int16">254</property>
		<property name="Top" vt="Int16">188</property>
		<property name="Width" vt="Int16">156</property>
		<property name="Height" vt="Int8">108</property>
		<property name="Caption" vt="String">Form1</property>
		<property name="Color" vt="Ident">clBtnFace</property>
		<property name="Font.Charset" vt="Ident">DEFAULT_CHARSET</property>
		<property name="Font.Color" vt="Ident">clWindowText</property>
		<property name="Font.Height" vt="Int8">-11</property>
		<property name="Font.Name" vt="String">MS Sans Serif</property>
		<property name="Font.Style" vt="Set"/>
		<property name="OldCreateOrder" vt="True">True</property>
		<property name="Visible" vt="True">True</property>
		<property name="Style" vt="Int32">-1798701056</property>
		<property name="ExStyle" vt="Int16">256</property>
		<property name="Version" vt="String">1.04</property>
		<property name="FormOptOnEvent" vt="False">False</property>
		<property name="FormOptExpVars" vt="False">False</property>
		<property name="FormOptPopulate" vt="False">False</property>
		<property name="FormOptVarsForSet" vt="False">False</property>
		<property name="FormOptIndentChar" vt="Int8">0</property>
		<property name="FormOptIndentCount" vt="Int8">1</property>
		<property name="FormOptIndentInit" vt="Int8">0</property>
		<property name="FormOptVarScope" vt="Int8">2</property>
		<property name="Resizing" vt="Set"/>
		<property name="PixelsPerInch" vt="Int8">96</property>
		<property name="TextHeight" vt="Int8">13</property>
	</properties>
	<components>
		<object type="TAButton" name="Button1">
			<properties>
				<property name="Left" vt="Int8">8</property>
				<property name="Top" vt="Int8">8</property>
				<property name="Width" vt="Int8">75</property>
				<property name="Height" vt="Int8">25</property>
				<property name="Caption" vt="String">Button1</property>
				<property name="TabOrder" vt="Int8">0</property>
				<property name="Color" vt="Ident">clBtnFace</property>
				<property name="CtrlStyle" vt="Int32">1342373888</property>
				<property name="CtrlExStyle" vt="Int8">0</property>
				<property name="Resizing" vt="Set">DockWidth, DockHeight</property>
			</properties>
			<components/>
		</object>
		<object type="TAInput" name="Input1">
			<properties>
				<property name="Left" vt="Int8">8</property>
				<property name="Top" vt="Int8">40</property>
				<property name="Width" vt="Int8">121</property>
				<property name="Height" vt="Int8">21</property>
				<property name="TabOrder" vt="Int8">1</property>
				<property name="Text" vt="String">Input1</property>
				<property name="CtrlStyle" vt="Int32">1342374016</property>
				<property name="CtrlExStyle" vt="Int16">512</property>
				<property name="Resizing" vt="Set">DockHeight</property>
			</properties>
			<components/>
		</object>
	</components>
</object>

I don't see anything wrong or missing in Koda. Did I say that I use Koda for everything. I use Koda for everything. :D 
2016.09.16koda.png

Edited by argumentum
added the pic. to show where to import from

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • 2 years later...
4 hours ago, LukeLe said:

AFAIK, both Koda and ISN AutoIT Studio have import functions for GUI.

Not sure about Koda, but AutoIt Form Studio doesn't have any import function.

5 hours ago, LukeLe said:

Creative GUI, but no "Undo" for GUI designing, so sad!

I believe the reason for this is that it is probably hard to implement an undo action in Form Studio, and besides, you can always remember the original parameters or save a backup of your GUI before messing with it :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

18 hours ago, TheDcoder said:

Not sure about Koda, but AutoIt Form Studio doesn't have any import function.

@TheDcoder Thanks for the correction. I was wrong about that.

About "Undo" action, I'm just a newbie so when doing with GUI, I just use the drag & drop function to place the GUI Ctrl in place.

Once you misplaced it, with ISN AutoIT Studio you need to place it back again, Koda can "Undo" these type of actions

The case I faced with ISN AutoIT is my Tab by somehow filled the whole GUI, and I can not figure out how to get it back to original place. I couldn't select the whole tabs, only can click tab & tab's internal item.

Couldn't find a solution, I deleted the form and switched to build GUI interface using Koda, saving it as a .au3 file in ISN AutoIT Studio project folder, when finished GUI designing, I'll continue using ISN AutoIT Studio.

Link to comment
Share on other sites

1 hour ago, LukeLe said:

The case I faced with ISN AutoIT is my Tab by somehow filled the whole GUI, and I can not figure out how to get it back to original place. I couldn't select the whole tabs, only can click tab & tab's internal item.

I recall that AutoIt Form Studio has a tree of controls, maybe you can select the Tab from there and adjust the properties manually.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

2 hours ago, TheDcoder said:

I recall that AutoIt Form Studio has a tree of controls, maybe you can select the Tab from there and adjust the properties manually.

I couldn't find where it is, could you please give some hint?
The only tree I saw is the Control Order, which is the same as Tab order in Koda

image.png.ad8ef6479dd107e290d86df6a5e69d62.png

Link to comment
Share on other sites

  • 1 month later...

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
 Share

×
×
  • Create New...