Jump to content

Recommended Posts

Posted

I want Line 4 - Cell1 to start from the beggining of line. How can i do that with Opt("GUICoordMode",2) enabled.

Thanks

Here is the code:

#include <GUIConstants.au3>

GUICreate("My GUI")  ; will create a dialog box that when displayed is centered

GUISetHelp("notepad")  ; will run notepad if F1 is typed

Opt("GUICoordMode",2)

GUICtrlCreateLabel ("Line 1 Cell 1",  10, 30, 70) ; first cell 50 width

GUICtrlCreateLabel ("Line 2 Cell 1",  -1, 0) ; next line

GUICtrlCreateLabel ("Line 3 Cell 2",  0, 0) ; next line and next cell 

GUICtrlCreateLabel ("Line 3 Cell 3",  0, -1) ; next cell same line

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0) ; next line Cell1

GUISetState ()      ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Posted

Remember that X and Y value can be use in relative mode. The -1 is just a facility. :)

#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUISetHelp("notepad") ; will run notepad if F1 is typed
Opt("GUICoordMode",2)
$widthCell=70
GUICtrlCreateLabel ("Line 1 Cell 1",  10, 30, $widthCell); first cell 70 width
GUICtrlCreateLabel ("Line 2 Cell 1",  -1, 0); next line
GUICtrlCreateLabel ("Line 3 Cell 2",  0, 0); next line and next cell  
GUICtrlCreateLabel ("Line 3 Cell 3",  0, -1); next cell same line 
GUICtrlCreateLabel ("Line 4 Cell 1",  -3*$widthcell, 0); next line Cell1

GUISetState ()   ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Posted

Another question. Why scroll is not working ??

Any ideas?

#include <GUIConstants.au3>

GUICreate("My GUI",550,400,-1,-1,BitOr($WS_VSCROLL,$WS_MINIMIZEBOX,$WS_GROUP,$WS_CAPTION,$WS_POPUP,$WS_SYSMENU))

GUISetHelp("notepad") ; will run notepad if F1 is typed

Opt("GUICoordMode",2)

$widthCell=70

GUICtrlCreateLabel ("Line 1 Cell 1",  10, 30, $widthCell); first cell 70 width

GUICtrlCreateLabel ("Line 2 Cell 1",  -1, 0); next line

GUICtrlCreateLabel ("Line 3 Cell 2",  0, 0); next line and next cell 

GUICtrlCreateLabel ("Line 3 Cell 3",  0, -1); next cell same line

GUICtrlCreateLabel ("Line 4 Cell 1",  -3*$widthcell, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 4 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 5 Cell 1",  -1, 0); next line Cell1

GUICtrlCreateLabel ("Line 6 Cell 1",  -1, 0); next line Cell1

GUISetState ()    ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Posted

Another question. Why scroll is not working ??

Any ideas?

<{POST_SNAPBACK}>

not sure what you want to scroll, but assuming it's the gui, you will need to include either $WS_VSCROLL and/or $WS_HSCROLL in your style specifications in your GUICreate statement
Posted

Cameronsdad please see my example. I already added $WS_VSCROLL but scroll is not working...

<{POST_SNAPBACK}>

sorry, i didn't see it, the way i have my browser sized (viewing forum from autoit help file) the line was broken at just the right spot for me to miss it. That's actually something i haven't used before so i was doing a little playing to see if i could get it to work... tried onevent mode and messageloop mode, and can't get a response on the scroll bar either way, except that it appears to set the $msg in messageloop mode to -7. you may be able to create your own solution to this... the platform sdk says that

The scroll bar sends WM_HSCROLL and WM_VSCROLL messages to the window procedure whenever the user clicks the scroll bar or drags the scroll box. The low-order words of WM_VSCROLL and WM_HSCROLL each contain a request code that indicates the direction and magnitude of the scrolling action.

When the WM_HSCROLL and WM_VSCROLL messages are processed, the scroll bar request code is examined and the scrolling increment is calculated. After the increment is applied to the current scrolling position, the window is scrolled to the new position by using the ScrollWindowEx function, and the position of the scroll box is adjusted by using the SetScrollInfo function.

After a window is scrolled, part of its client area is made invalid. To ensure that the invalid region is updated, the UpdateWindow function is used to generate a WM_PAINT message.

The platform sdk article on this explains how windows are created using the CreateWindowEx function which allows styles ws_vscroll and ws_hscroll (sounds familiar eh?) and has vb code for creating windows with scroll bars, and interpretting messages sent by the scroll bars. It seems to me that one of the awesome people that participate on these forums *cough* NOT ME *cough* could probably very quickly create a UDF to handle those messages.
Posted

Yes you have right gafrost. Scroll is not supported in GUI yet.

Any ideas how these labels in my code put them in a guiControl and make it scroll ?

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