Morthawt

Utilising existing GUI code in koda.

13 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

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

  • Similar Content

    • cookiemonster
      Loading window not closing and not staying on top of main window
      By cookiemonster
      Hi,
      I have a main window with one button, when i press that button it brings up a loading screen, but I have two problems with the loading screen at the moment:
      1) Once I have pressed the button, if i open something else full screen over this autoit project (eg: chrome), then on my task bar click on the autoit project to bring it up to the front, the loading screen does not stay on top of the main window, I tried using $WS_EX_TOPMOST but this makes the loading screen stay on top of all windows, I only want it to stay on top of $Main (my main window GUI)
      2) Once the loading screen has been updated to 100%, it should sleep for a further two seconds then close, but at the moment after that 2 seconds, it goes back down to 25% instead of $LoadingWindow being deleted.
      Has anyone got any thoughts or suggestions?
      #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <FontConstants.au3> $Main = GUICreate("Main Window", 600, 480, -1, -1, -1, $WS_EX_ACCEPTFILES) Global $button_Load = GUICtrlCreateButton("Loading Screen", 484, 98, 89, 20, $WS_GROUP) GUICtrlCreateTab(8, 16, 585, 424) GUICtrlCreateTabItem("Settings") GUICtrlCreateGroup("Settings", 16, 50, 569, 380) GUISetState(@SW_SHOWNORMAL) Func Load() WinSetState($Main, "", @SW_DISABLE) LoadingScreen("Loading @ 25%") GUICtrlSetData($LoadingPercent, 25) sleep(2000) LoadingScreen("Loading @ 100%") GUICtrlSetData($LoadingPercent, 100) sleep(2000) GUIDelete($LoadingWindow) WinSetState($Main, "", @SW_ENABLE) EndFunc Func LoadingScreen($LoadingText) ;Creates a Splash Text Screen with a progress bar. Global $LoadingWindow = GUICreate("", 500, 184, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW)) Global $LoadingPercent = GUICtrlCreateProgress(18, 144, 461, 25, $PBS_SMOOTH) GUICtrlCreateLabel($LoadingText, 2, 44, 494, 88, $SS_CENTER) GUICtrlSetFont(-1, 15, 800, 0, "Calibra", $CLEARTYPE_QUALITY) GUISetState(@SW_SHOW) EndFunc While (1) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button_Load Load() EndSwitch WEnd  
    • Katie_Deely
      Copying selected data from GUI Edit
      By Katie_Deely
      Hey
       
      I have a GUI with an edit-field and a button.
      First I write some text into the edit-field and select a part of it. After that I press the button, and the selection is edited.
      How would I do that, though? When the text is selected and I press the button, it's unselected before the button actually raises an event. 
    • Altor
      GUI problem with While loop and buttons
      By Altor
      Hi all
      My problem is that I have no way to work with buttons in a while loop
      When i run the form i can exit well clicking a close main window and olso if i click in a exit button but if i start the apllication whith a Start button  execute a loop for view a random numbers and then i can't stop the rogram and i can't not exit with a Exit button.
      I think the problem is in the use of events but i can not find the solution....
      Thank's to all
      The exemple is this:
      #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> Opt("GUIOnEventMode", 1) $random_numbers = GUICreate("Random numbers",351,171,-1,-1,-1,-1) GUISetOnEvent($GUI_EVENT_CLOSE, "close") $lavel_number = GUICtrlCreateLabel("",117,36,98,26,BitOr($SS_CENTER,$SS_CENTERIMAGE),$WS_EX_STATICEDGE) GUICtrlSetBkColor(-1,"0xFFFFFF") $start = GUICtrlCreateButton("Start",34,95,100,30,-1,-1) GUICtrlSetOnEvent(-1,"start") $stop = GUICtrlCreateButton("Pause",182,95,100,30,-1,-1) GUICtrlSetOnEvent(-1,"pause") $exit = GUICtrlCreateButton("Exit",112,136,100,30,-1,-1) GUICtrlSetOnEvent(-1,"close") GUISetState(@SW_SHOW) While 1 Sleep (50) Wend Func start() While 1 Sleep(100) Local $a = Random(1,10,1) GUICtrlSetData($lavel_number,$a) WEnd EndFunc Func pause() EndFunc func close() exit EndFunc  
    • Satvik
      Unable to open DLL files
      By Satvik
      Hi 
      I am trying to open a dll using DLLOpen, however everytime i try to do so the function fails and returns -1 result. 
      I have the dll in the same folder as the auto it script. 
      Local $hDLL = DllOpen("C:\Users\310255155\Downloads\COMMGvv2\commg.dll") DllCall($hDLL, "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0) DllClose($hDLL) MsgBox(0,'result',$hDLL)  
    • S0lidFr0st
      SQL Query Manipulation
      By S0lidFr0st
      Hello! I'm fairly new to using Autoit, I like the language and simplicity, however, there is a bit of a learning curve for me. I'm stuck and need some community help!
      I need to manipulate a query by using GUICtrlCreateDate to select the correct date and pipe the selected date into my actual query in a specific format (yyyymmdd).
      Here is an example:
      _Flag_RecordsetDisplay($sConnectionString, "select * from trips_to_complete_20161122 where trip_type in ('P','C') and trip_status in ('S','PC','DC') and Flagged = 1") Func _Flag_RecordsetDisplay($sConnectionString, $sQUERY) ; Create connection object Local $oConnection = _ADO_Connection_Create() ; Open connection with $sConnectionString _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then Return SetError(@error, @extended, $ADO_RET_FAILURE) ; Executing some query directly to Array of Arrays (instead to $oRecordset) Local $aRecordset = _ADO_Execute($oConnection, $sQUERY, True) ; Clean Up _ADO_Connection_Close($oConnection) $oConnection = Null ; Display Array Content with column names as headers _ADO_Recordset_Display($aRecordset, 'Recordset content') EndFunc ;==>_Flag_RecordsetDisplay The part of the query that needs modified is "trips_to_complete_20161122" I need to be able to select a date (via the gui) and that selection pipe into my query.  
       
      Thanks in Advanced!