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

    • ronaldo97
      By ronaldo97
      Hello How can I make the GUI is compatible with all screen sizes ??  
      #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 623, 445, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZE)) GUISetBkColor(0x1E1E1E) $Label1 = GUICtrlCreateLabel("Welcome Back !!", 424, 64, 161, 29) GUICtrlSetFont(-1, 16, 400, 0, "Tahoma") GUICtrlSetColor(-1, 0x800000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd How do I make Gui interface compatible with all screen sizes ?? 800*600
      1024*768
      1280*1024
    • Genotypek
      By Genotypek
      Hello.
      I've got a problem. I want to center my input vertically, but I don't have any single idea how to do it.
      There's my example code:
      #include <GUIConstantsEx.au3> $GUI = GUICreate("Gui", 237, 93, 192, 124) $Input1 = GUICtrlCreateInput("Center vertically isn't correct", 16, 16, 201, 62) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd What could I do?
      Greetings, "genotypek".
    • argv1
      By argv1
      Hi,
      working on my first autoit GUI an got some questions.
      Is it possible to get an action on the first menu level
      For example:
      $StartMenu = GUICtrlCreateMenu("Datei") ... while 1 Switch GUIGetMsg() Case $StartMenu MsgBox(0, "Test", "yes this works") (currently this does not work for me)
      Currently I have to create GUICtrlCreateMenuItem 's this will leed to a result
       
      And a 2nd question. I saw many time this:
      $StartMenu = GUICtrlCreateMenu("&Datei") For what does I need the ampersand? If I leave out the & nothing seems to change
       
      Thank you very much in advance
       
    • Blueman
      By Blueman
      Hey Guys,
      I am Struggling with a issue that i cannot seem to fix.
      I hope that you guys can help me with this.
      I have a GUI with some text attributes, for all i use the following code;
      $Label_ts_Header = GUICtrlCreateLabel("Manual Adress", 60, 10, 500, 50) GUICtrlSetBkColor($Label_ts_Header, $COLOR_WHITE) GUICtrlSetFont ($Label_ts_Header, 26, 800, 0, "Calibri") This is all working like it should, but when i activate the GUI on another pc the text size is bigger and the GUI size is somewhat smaller.
      The problem is that it isn't on all computers, i can't seem to find the problem,..
      If i make it fit on one pc it is to small on another or to big,..
      What am i doing wrong?
       
      Is there some kind of attribute that i need to add to the top of my script to normalize text sizes in the script?
       
      Thanks!
       
      EDIT: Found the problem guys, some computers has changed the text size to 125% // Can i force 100% for my GUI somehow ?
       
      EDIT2: Fixed it guys! // I used the Function Below to get the DPI Setting and used that to determine the text size (example below)
       
      Func _GDIPlus_GraphicsGetDPIRatio($iDPIDef = 96) _GDIPlus_Startup() Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(0) If @error Then Return SetError(1, @extended, 0) Local $aResult #forcedef $__g_hGDIPDll, $ghGDIPDll $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @extended, 0) Local $iDPI = $aResult[2] Local $aresults[2] = [$iDPIDef / $iDPI, $iDPI / $iDPIDef] _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Return $aresults EndFunc ;==>_GDIPlus_GraphicsGetDPIRatio  
      $Label_S2 = GUICtrlCreateLabel("Data from The Base", 10, 300, 400, 20) GUICtrlSetBkColor($Label_S2, $COLOR_WHITE) GUICtrlSetFont ($Label_S2, 13 * _GDIPlus_GraphicsGetDPIRatio()[0])  
       
    • Masum
      By Masum
      Hi all,
      Can the default Koda icon for forms be changed? If so, how?
      Thanks