Jump to content

Recommended Posts

Posted (edited)

"Generate OnEvent code" (and similar) options in settings are default ones and they are apply to any newly created form. So, if you create form when this option was True, form will have this option always True, until you change it for this form in the Tools->Generating Options.

Yes. I thought that it's application's option not related to opened forms.

When I have previously opened form and I change only this option from Tools/Options and press "Run".

But I haven't open/create new forms.

Edited by Zedna
Posted

Koda add this.

Do you "attached" updown control to input control? Updown control alone have no sense and not generating anything.

you'll find the attached example form with an updown control and a statusbar. I'm using v. 1.7.0.5 beta.

Here's the generated code:

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StatusBarConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\TEMP\UpDown.kxf

$Form1 = GUICreate("Form1", 381, 301, 193, 125)

$Input1 = GUICtrlCreateInput("Input1", 56, 64, 89, 21)

$StatusBar1 = _GUICtrlStatusBar_Create($Form1)

_GUICtrlStatusBar_SetMinHeight($StatusBar1, 25)

GUISetState(@SW_SHOW)

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

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

I must manually include the statement: #include <GuiStatusBar.au3> in order to avoid compilation error (with the latest autoit beta release).

No statement: $updown = GUICtrlCreateUpdown($input1) generated

UpDown.zip

Posted

If users add a statusbar to a form, the generated code should insert the followin include statement:

#Include <GuiStatusBar.au3>

Sorry, really, this was already fixed in in my snapshot, which not released yet...

Yes. I thought that it's application's option not related to opened forms.

When I have previously opened form and I change only this option from Tools/Options and press "Run".

But I haven't open/create new forms.

Yeah, behaviour of options in the settings dialog was changed, when Koda start saving those options in the form.

you'll find the attached example form with an updown control and a statusbar. I'm using v. 1.7.0.5 beta.

...

I must manually include the statement: #include <GuiStatusBar.au3> in order to avoid compilation error (with the latest autoit beta release).

No statement: $updown = GUICtrlCreateUpdown($input1) generated

gcriaco, to attach updown you should for Input1 set "UpDown" property. It have dropdown list with all updown controls available on form.
Posted (edited)

gcriaco, to attach updown you should for Input1 set "UpDown" property. It have dropdown list with all updown controls available on form.

OK. Thank you.

Anyway, IMHO if an updown control is not joined to an input control, Koda should display a warning message before starting the code generation. It's just an opinion.

Many thanks again for sharing Koda with us

Peppe

Edited by gcriaco
  • 3 weeks later...
Posted

Well, so long from the last update, but finally here is new one ;)

http://www.autoitscript.com/fileman/users/lookfar/koda_2008-09-03.zip

Added Toolbar and ImageList creating support, right now very basic, so I need some advices what another properties are reasonable to add for visual editing.

Also made an experimental change, now images that loaded into Pic, Icon, Button (and new Imagelist) controls are not save inside form. This was Delphi legacy, because it keep images inside form. For Koda and Autoit this is pointless, since you still need to have external image in order to script work. This change greatly reduce size of forms with big images linked and noticeable increase their loading speed.

Posted (edited)

There is still "old bug" with bad order of controls in code generator:

If you place main menu and statusbar control (and others) on the form

then menu must be first and statusbar last (statusbar must be AFTER menu - not before).

Here is what Koda produces, but it doesn't work:

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiStatusBar.au3>
#include <GuiToolbar.au3>
#include <ImageListConstants.au3>
#include <ToolbarConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 593, 453, 193, 115, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
$ImageList1 = _GUIImageList_Create(16, 16, 5)
_GUIImageList_AddIcon($ImageList1, "C:\Program Files\AutoIt3\SciTE\Koda\FD.exe", 0)
_GUIImageList_AddIcon($ImageList1, "C:\Program Files\AutoIt3\SciTE\Koda\FD.exe", 4)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
$ToolBar1 = _GUICtrlToolbar_Create($Form1, 0)
_GUICtrlToolbar_SetImageList($ToolBar1, $ImageList1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 0)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 2)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 3)
$MenuItem2 = GUICtrlCreateMenu("MenuItem2")
$MenuItem4 = GUICtrlCreateMenuItem("MenuItem4", $MenuItem2)
$MenuItem3 = GUICtrlCreateMenuItem("MenuItem3", $MenuItem2)
$MenuItem1 = GUICtrlCreateMenu("MenuItem1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

 EndSwitch
WEndoÝ÷ Øw«z+¢ºÞr×r^jëh×6#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiStatusBar.au3>
#include <GuiToolbar.au3>
#include <ImageListConstants.au3>
#include <ToolbarConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 593, 453, 193, 115, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
$MenuItem2 = GUICtrlCreateMenu("MenuItem2")
$MenuItem4 = GUICtrlCreateMenuItem("MenuItem4", $MenuItem2)
$MenuItem3 = GUICtrlCreateMenuItem("MenuItem3", $MenuItem2)
$MenuItem1 = GUICtrlCreateMenu("MenuItem1")
$ImageList1 = _GUIImageList_Create(16, 16, 5)
_GUIImageList_AddIcon($ImageList1, "C:\Program Files\AutoIt3\SciTE\Koda\FD.exe", 0)
_GUIImageList_AddIcon($ImageList1, "C:\Program Files\AutoIt3\SciTE\Koda\FD.exe", 4)
$ToolBar1 = _GUICtrlToolbar_Create($Form1, 0)
_GUICtrlToolbar_SetImageList($ToolBar1, $ImageList1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 0)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 1)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 2)
_GUICtrlToolbar_AddButton($ToolBar1, 0, 3)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

 EndSwitch
WEnd
Edited by Zedna
Posted

In this latest beta 1.7.0.6 is not updated Czech language file for Koda 1.7.0.5

Yea, I forget to replace languages in release folder... I will update archive.

For ListView columns widths

Instead of

GUICtrlSendMsg(-1, 0x101E, 0, 50)

would be better:

GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
Agree. And no problem with missed declaration now, since ListViewConstants.au3 included anyway when control once appears.

_GUICtrlListView_JustifyColumn(ControlGetHandle($ListView1), 1, 1)

produces error: ControlGetHandle() [built-in] called with wrong number of args.

Damn, what the silly mistake ;)

When I add buttons and then set style to buttons (tbsSeparator), generated code doesn't contain any style related code.

- Enabled,Visible property has no effect (visual or code)

Yes, this was forget and/or unfinished yet :D Also, looks like tbsDivider is Delphi only and have not API equivalent?

There is still "old bug" with bad order of controls in code generator:

If you place main menu and statusbar control (and others) on the form

then menu must be first and statusbar last (statusbar must be AFTER menu - not before).

No, this is by design. Actually, menu - non-visual component and have not TabOrder property. So this handled in flow, different from regular controls. Is this cause any problems?

- there is no way to set "flat" toolbar style?

- Add library: index is disabled but in generated code is_GUIImageList_AddIcon() for that

Set TBSTYLE_FLAT for toolbar.

Not got second sentence...

In ToolBar button properties:

At "Image index" property can be the same DropDown with images as in ImageList editor dialog at "Image index"

Maybe in future, it's need to write special property editor for that.
Posted

No, this is by design. Actually, menu - non-visual component and have not TabOrder property. So this handled in flow, different from regular controls. Is this cause any problems?

Yes. This is problem. You may try it.

StatusBar is not visible at runtime because is has bad Top position (it not reflects height of menu control).

Posted (edited)

 

Not got second sentence...

What is difference between "Add single" and "Add library" (at design time and in generated code)? 

EDIT:

Nevermind. I found its logic now.

I tried "Add library" on Scite.exe which has only one icon so I didn't see difference. When you choose some library containing more icons (for example fd.exe) you will see difference :-)

Edited by Zedna
Posted

Yes. This is problem. You may try it.

StatusBar is not visible at runtime because is has bad Top position (it not reflects height of menu control).

Yeah, this make the sense. What is good for context menus, not too good main menu. At least main menu should be placed right after GUI creating. I'll try to change it.

I tried "Add library" on Scite.exe which has only one icon so I didn't see difference. When you choose some library containing more icons (for example fd.exe) you will see difference :-)

Terminology is bad, agree. I'm already tried few different variants (Fill... Multiple...), but this thing still not clear ;)

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...