Jump to content

GUI Designer: Koda 1.7.3.0


Recommended Posts

With OnEvent mode set as an option, the events for menu items can be incorrectly placed at the end of the gui creation instead of immediately after the control cretaion.

Here is an example

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=g:\moe\moe_spacerlabels.kxf
$MOELabelPrintForm = GUICreate("Spacer Label Printing - MOE", 375, 466, 197, 122)
$MenuHelp = GUICtrlCreateMenu("&Help");<---------------------------------------------------------------------here is a menu item
$MenuItemAbout = GUICtrlCreateMenuItem("About", $MenuHelp);<--------------------------------------- and another
GUISetFont(10, 400, 0, "MS Sans Serif")
GUISetBkColor(0xCEE3CE)
GUISetOnEvent($GUI_EVENT_CLOSE, "MOELabelPrintFormClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "MOELabelPrintFormMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "MOELabelPrintFormMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "MOELabelPrintFormRestore")
$Input1 = GUICtrlCreateInput("", 185, 278, 84, 24, BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetOnEvent(-1, "Input1Change")
GUICtrlSetOnEvent(-1, "UpDnCopiesChange")
$IPCopis = GUICtrlCreateInput("0", 209, 312, 46, 24, BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
$UpDnCopies = GUICtrlCreateUpdown($IPCopis)
GUICtrlSetLimit(-1, 99, 1)
GUICtrlSetOnEvent(-1, "IPCopisChange")
$BtnStartPrint = GUICtrlCreateButton("Start Print", 185, 350, 84, 39)
GUICtrlSetOnEvent(-1, "BtnStartPrintClick")
$BtnAbortPrint = GUICtrlCreateButton("Abort Print", 60, 364, 84, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "BtnAbortPrintClick")
$Label1 = GUICtrlCreateLabel("Number of each label", 64, 315, 132, 20)
GUICtrlSetOnEvent(-1, "Label1Click")
$Label2 = GUICtrlCreateLabel("Optimised Batch No.", 55, 280, 126, 20)
GUICtrlSetOnEvent(-1, "Label2Click")
$Label3 = GUICtrlCreateLabel("Labels are created from", 49, 10, 169, 20, $SS_CENTER)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800000)
GUICtrlSetOnEvent(-1, "Label3Click")
$Label4 = GUICtrlCreateLabel("Optimised Result Batches.", 48, 33, 186, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x800000)
GUICtrlSetOnEvent(-1, "Label4Click")
$Group1 = GUICtrlCreateGroup("Options", 31, 74, 311, 190)
$Radio1 = GUICtrlCreateRadio("Print in job number sequence ", 51, 98, 242, 17)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "Radio1Click")
$Radio2 = GUICtrlCreateRadio("Print in slot rack order", 51, 130, 233, 17)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "Radio2Click")
$Label5 = GUICtrlCreateLabel("NB slot order can be the same as ", 71, 151, 205, 20)
GUICtrlSetOnEvent(-1, "Label5Click")
$Label6 = GUICtrlCreateLabel("job number order if set that way in ", 73, 171, 203, 20)
GUICtrlSetOnEvent(-1, "Label6Click")
$Label7 = GUICtrlCreateLabel("the optimiser.", 73, 190, 83, 20)
GUICtrlSetOnEvent(-1, "Label7Click")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox1 = GUICtrlCreateCheckbox("Generate cutting list for automatic saw", 56, 225, 273, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "Checkbox1Click")
GUICtrlSetOnEvent(-1, "MenuHelpClick"),<------------------------------------------------------------------------but the event is set here in the wrong place.
GUICtrlSetOnEvent(-1, "MenuItemAboutClick");<---------------------------------------------------------------same problem
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Version 1.7.2.1 build 191 (beta)

Edited by martin
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.
Link to post
Share on other sites
  • Replies 816
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

New version 1.7.3.0 is out! Download current release Place to post bugs and suggestions (Bug tracker) Online help (Wiki) What's new: Graphic editor Better support of limited accounts and UAC under

Just to say, I think LazyCat did an awesome job on this. Anytime I need to create a GUI, I always start off with KODA. I don't build the entire GUI with it, but it's a great starting point and has

That link is now broken. But maybe this one might be helpful for some https://blog.csdn.net/analogous_love/article/details/42264605

Posted Images

With OnEvent mode set as an option, the events for menu items can be incorrectly placed at the end of the gui creation instead of immediately after the control cretaion.

Hm, there is already ticket for the similar thing. So, this is not only TrayMenu related...
Link to post
Share on other sites

Without doubt, it's great. :D

Unfortunately,atfer tried, I found it will delete script inside gui creating scripts. If it can work with au3 script already exist, I will say Koda is perfect. :huggles:

It have "update" function, this allow to update GUI part in the existing script. If you mean code blocks inside the GUI block - yes, this is not supported yet, but I have an idea how it can be done.
Link to post
Share on other sites

Hi, Lazycat

Firstly i want to say Cпосибо for Koda.Great Job!

But i have troubles with Koda.May be this bug.

Koda cannot handle correct somethink with permissions on WIN XP SP2.

Because i cannot use it From:

C:\Program Files\AutoIt3\SciTE\Koda

Problem was here:

From Scite i cannot execute Koda.Because Koda will crash in this case.(Always)

This is right for directly call from shortcut too Koda Form Designer cannot start and crash.(I mean install location of koda => C:\Program Files\AutoIt3\SciTE\Koda

Posted Image

and i execute it from Desktop with Shortcut.)

I use on my comp Restricted user account in this case not admin.

And this occurs in restircted user rights.

When i execute Koda from Administrative right account it start normally.

And i think isuse here:

Resticted users cannot write to %programfiles% and to it`s sub dirs.And I think this isuse successfully crash Koda.(Witout user interaction.)

Here is owners:

C:\Program Files\AutoIt3\SciTE\Koda>dir /Q
 Том в устройстве C не имеет метки.
 Серийный номер тома: 603F-1969

 Содержимое папки C:\Program Files\AutoIt3\SciTE\Koda

16.01.2010 23:16    <DIR>   SWEET-GIRL\Администрато.
16.01.2010 23:16    <DIR>   SWEET-GIRL\Администрато..
16.01.2010 19:07    <DIR>   SWEET-GIRL\Domain   Extras
05.09.2006 02:04    100 670 SWEET-GIRL\АдминистратоFD.chm
27.06.2009 19:06    660 480 SWEET-GIRL\Domain   FD.exe
16.01.2010 19:12    3 552 SWEET-GIRL\Domain     fd.xml
24.05.2008 12:01    3 641 SWEET-GIRL\Администратоfd_old.xml
10.09.2007 00:21    <DIR>   SWEET-GIRL\АдминистратоForms
27.06.2009 19:08    32 033 SWEET-GIRL\Domain    history.txt
10.01.2010 23:50    1 046 915 SWEET-GIRL\Domain     koda_1.7.2.0.zip
16.01.2010 19:07    <DIR>   SWEET-GIRL\АдминистратоLanguage
03.10.2008 12:25    35 021 SWEET-GIRL\Domain    styles.xml
16.01.2010 19:07    <DIR>   SWEET-GIRL\АдминистратоTemplates
    7 файлов  1 882 312 байт
    6 папок 23 365 754 880 байт свободно

C:\Program Files\AutoIt3\SciTE\Koda>

+ When i use standalone version of Koda for example from

extracted location: From My docs, or from C:\downloads it didnt Crash and works fine.

All versions of Koda have this isuse.

I`m sure this is not installation problem.

My OS win XP SP2 (ru) 5.1.2600

Was Checked for Spyware + for viri and etc. Computer Is "Clean".I mean no suspicious files or processes.

DEP on my OS is not applicable for 3`rd party apps.In this case this is not isuse with DEP.

+

Firewall +Application Monitoring is oFF (i mean under test).

Here is crash dump for Koda:

Posted Image

Here is crash dump for Koda:

Тип события:  Ошибка
Источник события:    Application Error
Категория события:  Отсутствует
Код события:  1000
Дата:       16.01.2010
Время:     19:03:17
Пользователь:       Н/Д
Компьютер: SWEET-GIRL
Описание:
Ошибка приложения fd.exe, версия 1.7.1.0, модуль kernel32.dll, версия 5.1.2600.2991, адрес 0x00012a5b.
Данные:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 66 64 2e ure fd.
0018: 65 78 65 20 31 2e 37 2e exe 1.7.
0020: 31 2e 30 20 69 6e 20 6b 1.0 in k
0028: 65 72 6e 65 6c 33 32 2e ernel32.
0030: 64 6c 6c 20 35 2e 31 2e dll 5.1.
0038: 32 36 30 30 2e 32 39 39 2600.299
0040: 31 20 61 74 20 6f 66 66 1 at off
0048: 73 65 74 20 30 30 30 31 set 0001
0050: 32 61 35 62 0d 0a     2a5b.. 

###############
Here is exception:
POP ESI 
007c812a5b  <== Always same:(Only for know where is problem)
###############

+ Here is i write script for dump Koda proccess(FD.exe) when i execute it and when it crash (Sorry for Unclear):

ShellExecute(@ProgramFilesDir&"\AutoIt3\SciTE\Koda\FD.exe")
Sleep(300)
If ProcessExists("FD.EXE") Then
    detect()
    EndIf
#cs     Usage Of procdump
C:\Downloads\Movie>procdump.exe

ProcDump v1.7 - Writes process dump files
Copyright (C) 2009 Mark Russinovich
Sysinternals - www.sysinternals.com

Monitors a process and writes a dump file when the process exceeds the
specified CPU usage.

usage: procdump [-64] [[-c CPU usage] [-u] [-s seconds]] [-n exceeds] [-e] [-h] [-m commit usage] [-ma] [-o] [-r] [-t]
< <process name or PID> [dump file]] | [-x <image file> <dump file> [arguments]>
 -64    By default Procdump will capture a 32-bit dump of a 32-bit process
    when running on 64-bit Windows. This option overrides to create a
    64-bit dump.
 -c     CPU threshold at which to create a dump of the process.
 -e     Write a dump when the process encounters an unhandled exception.
 -h     Write dump if process has a hung window (does not respond to
    window messages for at least 5 seconds.
 -m     Memory commit threshold in MB at which to create a dump of the
    process.
 -ma    Write a dump file with all process memory. The default
    dump format includes thread and handle information.
 -n     Number of dumps to write before exiting.
 -o     Overwrite an existing dump file.
 -r     Reflect (clone) the process for the dump to minimize the time
    the process is suspended (Windows 7 and higher only).
 -s     Consecutive seconds CPU threshold must be hit before dump is
    written (default is 10).
 -t     Write a dump when the process terminates.
 -u     Treat CPU usage relative to a single core.
 -x     Launch the specified image with optional arguments.
Use the -accepteula command line option to automatically accept the
Sysinternals license agreement.

To just create a dump of a running process, omit the CPU threshold. If
you omit the dump file name, it defaults to <processname>.dmp.

Example: Write up to 3 dumps of a process named 'consume' when it exceeds
    20% CPU usage for five seconds to the directory
    c:\dump\consume with the name consume.dmp:
    C:\>procdump -c 20 -s 5 -n 3 -o consume c:\dump\consume
Example: Write a dump for a process named 'hang.exe' when one of it's
    windows is unresponsive for more than 5 seconds:
    C:\>procdump -h hang.exe hungwindow.dmp
Example: Write 3 dumps 5 seconds apart:
    C:\>procdump -s 5 -n 3 notepad.exe notepad.dmp
Example: Launch a process and then monitor it for excessive CPU usage:
    C:\>procdump -c 30 -s 10 -x consume.exe consume.dmp
Example: Write a dump of a process named 'iexplore' to a dump file
    that has the default name iexplore.dmp:
    C:\>procdump iexplore


#ce


Func detect()
while 1
if ProcessExists("FD.EXE") Then
Run("cmd.exe /c " & "C:\Downloads\Movie\procdump.exe -accepteula -e FD.exe","",@SW_ENABLE)
MsgBox(64,"DUMP WRITED!","DUMP SUCESSFULLY WRITED!")
if @error Then
    MsgBox(48,"ERROR!","ERROR")
    EndIf

ExitLoop
if Not ProcessExists("FD.EXE") Then
    ProcessWait("FD.EXE")
if ProcessExists("FD.EXE") Then


    Run("cmd.exe /c " & "C:\Downloads\Movie\procdump.exe -accepteula -e FD.exe","",@SW_ENABLE)
    MsgBox(64,"DUMP WRITED!","DUMP SUCESSFULLY WRITED!",1)
Endif
    ExitLoop

    EndIf
EndIf

WEnd
EndFunc;<== detect()

Result here is Complete dump when it crash:

CrashDump (rar)

LazyCat what do you think is it bug?

Thank in Advance & Sorry for my awfull English.

Edited by Sh3llC043r
[size="5"] [/size]
Link to post
Share on other sites

Resticted users cannot write to %programfiles% and to it`s sub dirs.And I think this isuse successfully crash Koda.(Witout user interaction.)

Just tested, this is only the reason for the trouble. Koda was always positioned as portable app. Obviously, you can install Koda outside Program Files or give writing privilege for Koda folder to regular user group. But I think will be more correct to add restricted user mode: if Koda is not able to write to it's folder, use subfolder under Application Data.
Link to post
Share on other sites
  • 2 weeks later...

Here is Czech language file updated from 1.7.1.1 to 1.7.2.1 (only one added message)

One cosmetic bug in Koda:

When I created template for new language file (from latest Koda beta) based on the Czech language then

at the end of "C:\Program Files\AutoIt3\SciTE\Koda\Language\template_cze.xml" was few empty fields <Form name=""/>:

...

 <form name="frmMenuBuilder">

     <caption>Menu Designer</caption>

     <InsertItem property="Caption">&amp;Přidat</InsertItem>

     <DeleteItem property="Caption">&amp;Smazat</DeleteItem>

     <CreateSubmenu property="Caption">&amp;Vytvořit Podmenu</CreateSubmenu>

 </form>

 <Form name=""/>

 <Form name=""/>

 <Form name=""/>

 <Form name=""/>

 <Form name=""/>

 <Form name=""/>

</language>

EDIT: Lazycat do you want me to post updated language files rather on Trac next time?

Edited by Zedna
Link to post
Share on other sites

One cosmetic bug in Koda:

When I created template for new language file (from latest Koda beta) based on the Czech language then

at the end of "C:\Program Files\AutoIt3\SciTE\Koda\Language\template_cze.xml" was few empty fields <Form name=""/>:

Yes, confirm. I'll look.

EDIT: Lazycat do you want me to post updated language files rather on Trac next time?

This is for your decide. I'll get it anywhere :D

Link to post
Share on other sites

New beta is out. Hopefully fixed most of annoying bugs. Some new features added as well.

Download

Changes:

Beta 1.7.2.2 build 204 (2010-02-04)
2010-02-04 - Added: option to not generate ImageList itself when using for Listview/Treeview
2010-02-03 - Added: warning if user have outdated "styles.xml" file
2010-02-03 - Added: forgotten styles for Toolbar buttons
2010-02-03 - Added: ability to generate TreeView with icons
2010-02-03 - Added: ability to generate ListView with icons
2010-02-03 - Fixed: visual appearance of ListView control [FS#86]
2010-02-02 - Added: checking of actual clipboard content on paste [FS#7][FS#57]
2010-02-02 - Added: ability to save settings in the AppData folder under restricted account
2010-02-02 - Fixed: crash when running Koda first time under restricted account (thanks Sh3llC043r)
2010-02-02 - Fixed: small cosmetic issue with translation files (thanks Zedna)
2010-02-02 - Fixed: various bugs with Graphic editor (thanks Zedna)
2010-02-01 - Added: ability to generate tabs with icons (GUITab.au3 incluse used)
2010-02-01 - Fixed: wrong styles visually appearing after form loading [FS#83] (thanks monter.FM)
2010-02-01 - Fixed: events for menus generated in wrong place [FS#78]
2010-02-01 - Fixed: event for Tab generated in wrong place [FS#87]
2010-02-01 - Added: forgotten Icon property for TrayMenu
2010-02-01 - Added: ability to copy Dummy controls [FS#60]
2010-02-01 - Changed: redone a bit invisible components handling (internal)
2010-02-01 - Changed: all Dummy controls are generating in one place [FS#51]
2010-02-01 - Fixed: generating of custom image path with macro [FS#68]
2010-02-01 - Fixed: index for GUI icon was not generated [FS#80]
2010-01-31 - Fixed: enabled states for different items [FS#95] (thanks Tlem)
2010-01-31 - Fixed: wrong include for Group [FS#90]
2010-01-31 - Added: French language file (thanks Tlem)
2009-08-11 - Added: Chinese(Traditional) language file (thanks rexx)
2009-08-03 - Fixed: form position not reloaded when position is poFixed
2009-08-03 - Fixed: flaw in saving form options (thanks martin)
Link to post
Share on other sites

New beta is out. Here is a big change, that I want to do for long time - styles editor is fully rewritten. It should be more robust now, and support changing styles for multiple controls at once. This feature acts very similar to property inspector. If selected controls are the same type (in Autoit scope), you can modify all styles. If types are different, you still can change common styles (for example, BS_LEFT for Button and Checkbox).

Hopefully nothing was broken with this change, so please test it.

Download

Link to post
Share on other sites

On Windows Vista/7 the file association Set/Remove buttons give an error and do not change the associations. This is obviously due to UAC. In order to be properly compliant on Vista/7 you need to put the UAC shield on those buttons (Send BCM_SETSHIELD with lParam TRUE to show the shield on those buttons). Clicking the buttons should of course spawn a new process as administrator. How you do this is up to you. I would personally add a special command-line switches to Koda to register/unregister the associations and just ShellExecute("runas") that (Koda SHOULD NOT continue running, it should only change the association then close). You could use an AutoIt script that has #RequireAdmin in it which might be easier.

It's pretty trivial but should be taken care of. I had to briefly run Koda as administrator just to click a single button in options. Silly.

Link to post
Share on other sites

I've also just found a bug. According to the AutoIt documentation for Input controls, $WS_TABSTOP is a forced style unless $ES_READONLY is specified. However, Koda is always forcing $WS_TABSTOP even when $ES_READONLY is specified. I have no way of removing $WS_TABSTOP from Koda's UI even though I really am using a read-only input control and do not want it to be a tabstop.

Link to post
Share on other sites

On Windows Vista/7 the file association Set/Remove buttons give an error and do not change the associations. This is obviously due to UAC. In order to be properly compliant on Vista/7 you need to put the UAC shield on those buttons (Send BCM_SETSHIELD with lParam TRUE to show the shield on those buttons). Clicking the buttons should of course spawn a new process as administrator. How you do this is up to you. I would personally add a special command-line switches to Koda to register/unregister the associations and just ShellExecute("runas") that (Koda SHOULD NOT continue running, it should only change the association then close). You could use an AutoIt script that has #RequireAdmin in it which might be easier.

It's pretty trivial but should be taken care of. I had to briefly run Koda as administrator just to click a single button in options. Silly.

Agree, with UAC it's far better when app support this natively. I'll look for it.

I've also just found a bug. According to the AutoIt documentation for Input controls, $WS_TABSTOP is a forced style unless $ES_READONLY is specified. However, Koda is always forcing $WS_TABSTOP even when $ES_READONLY is specified. I have no way of removing $WS_TABSTOP from Koda's UI even though I really am using a read-only input control and do not want it to be a tabstop.

Seems this is correct for Edit too. Not sure, this meant that WS_TABSTOP should not be in style when ES_READONLY is set, or it's just not forced and can be or can not be?
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...