Jump to content
Sign in to follow this  
Kyan

Koda designer Updown control bug?

Recommended Posts

Kyan

Hi everyone :)

I'm using Koda designer 1.7.3.0 b252 and i cannot set the position for a updown control after I associate a input to that updown I want to put it a bit more to the left, around 63px left

here's the code

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 193, 156)
$Label1 = GUICtrlCreateLabel("Label", 8, 8, 38, 18)
GUICtrlSetFont(-1, 8, 800, 0, "Arial")
$Label3 = GUICtrlCreateLabel("/8", 56, 8, 13, 18)
GUICtrlSetFont(-1, 8, 800, 0, "Arial")
$Input1 = GUICtrlCreateInput("6", 45, 8, 27, 22, $ES_RIGHT, 0)
GUICtrlSetFont(-1, 8, 800, 0, "Arial")
$Updown1 = GUICtrlCreateUpdown($Input1)
GUICtrlSetLimit(-1, 6, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

EndSwitch
WEnd
Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
BrewManNH

GUICtrlCreateUpDown will only put the up/down control into the connected input control. Your input control is only 27px wide, so you can't move it 63px to the left because there's no control there. Also, your Input control is only 45px to the right of the left edge of the GUI which makes the right edge only 72 pixels from the left as well, so unless you're planning on putting your up/down control out somewhere that you can't see it, moving it left 63 pixels isn't going to help much.

Creating it like this: "$Updown1 = GUICtrlCreateUpdown($Input1, $UDS_ALIGNLEFT)" might help.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Kyan

I didn't understand, why I cannot put a Updown control away from a input?

I want to do something like this:

Posted Image

Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

Just use a hidden input and link it to a visible one: ;)

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

$hGUI = GUICreate("Test", 500, 500)

$cInput_Vis = GUICtrlCreateInput("", 10, 10, 20, 20)

GUICtrlCreateLabel(" / 7", 30, 12, 30, 20)

$cInput_Hid = GUICtrlCreateInput("", 60, 10, 17, 20)
GUICtrlCreateUpdown($cInput_Hid)

GUISetState()

GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Switch BitAND($wParam, 0xFFFF)
        Case $cInput_Hid
            Switch BitShift($wParam, 16)
                Case $EN_CHANGE
                    GUICtrlSetData($cInput_Vis, GUICtrlRead($cInput_Hid))
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_COMMAND

All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Kyan

Thanks Melba, its great :D

why do you perform BitShift() to $wParam?


Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

The BitAND and BitShift operations get the low and high parts of $wParam respectively - these hold the ControlID and the Message Code which we need to run the Switch. All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Kyan

DiOgO,

The BitAND and BitShift operations get the low and high parts of $wParam respectively - these hold the ControlID and the Message Code which we need to run the Switch. All clear? :)

M23

I know what a bit is, but high/low parts and shift 16 to the right :s

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

$wParam is a 32-bit integer - shifting it right by 16 means that only the high part remains:

; Original
11111111111111110000000000000000
; BitShift 16 - move 16 to the right and fill with zeros
00000000000000001111111111111111

For the low word we use BitAND - FFFF = 1111111111111111

; Original
10101010101010101111111111111111
; BitAND 0xFF
00000000000000001111111111111111
; Result - only bits where both are set
00000000000000001111111111111111

Does that explain it better? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Kyan

DiOgO,

$wParam is a 32-bit integer - shifting it right by 16 means that only the high part remains:

; Original
11111111111111110000000000000000
; BitShift 16 - move 16 to the right and fill with zeros
00000000000000001111111111111111

For the low word we use BitAND - FFFF = 1111111111111111

; Original
10101010101010101111111111111111
; BitAND 0xFF
00000000000000001111111111111111
; Result - only bits where both are set
00000000000000001111111111111111

Does that explain it better? :)

M23

well yes, but high part and low word, what does it means exactly? (sorry for keep asking things, is my last questions :) )

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

It is a clever way of getting 2 small items of information into a single larger (in fact double size) parameter. ;)

Take 2 numbers: 2012 (0x07DD) and 9999 (0x270F). The two can be combined like this: 0x07DD270F (131933967). 07DD is known as the "Hi" word and 270F as the "Lo" word. Those Bit operators I explained above separate them again.

Any clearer? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Kyan

DiOgO,

It is a clever way of getting 2 small items of information into a single larger (in fact double size) parameter. ;)

Take 2 numbers: 2012 (0x07DD) and 9999 (0x270F). The two can be combined like this: 0x07DD270F (131933967). 07DD is known as the "Hi" word and 270F as the "Lo" word. Those Bit operators I explained above separate them again.

Any clearer? :huh:

M23

yup :D

but with BitShift both operations can be done BitShift($var,16) and BitShift($var,-16), can not?


Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

No - remember that we are only interested in the "bottom" 16 bits - we want the "top" 16 bits to be set to 0. BitShift(16) puts the "Hi" 16 bits into the "bottom" 16 and fills the "top" with 0's. If you were to useBitShift(-16) you would put the "Lo" 16 bits into the "top" 16 and fill the "bottom with 0's - not at all what we want. That is why you need the BitAnd to mask out the "top" bits with 0's and leave the "bottom" alone. ;)

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Kyan

DiOgO,

No - remember that we are only interested in the "bottom" 16 bits - we want the "top" 16 bits to be set to 0. BitShift(16) puts the "Hi" 16 bits into the "bottom" 16 and fills the "top" with 0's. If you were to useBitShift(-16) you would put the "Lo" 16 bits into the "top" 16 and fill the "bottom with 0's - not at all what we want. That is why you need the BitAnd to mask out the "top" bits with 0's and leave the "bottom" alone. ;)

M23

makes sence, by some reason I thought that bitshift(,-16) and bitand() would do the same :unsure:

thanks again Melba, you help me a lot ;)


Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

Delighted I could help - and that you understood my explanations. :D

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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
Sign in to follow this  

×