Jump to content

help positioning gui


XY16
 Share

Recommended Posts

hi guys, i have a little gui i need positioning correctly. as i am blind, i am unable to position it my self. i would be very grateful if someone would help with this.

;create a gui

Local $GUI = GUICreate("Shared folder", "900", "900")

;define a status bar

Local $SBar = _GUICtrlStatusBar_Create($GUI)

;set the status bar text

_GUICtrlStatusBar_SetText($SBar, "Select shared folder to send a message to.")

;create gui buttons

Local $F1 = GUICtrlCreateButton("1", 40, 100, 80, 30)

Local $F2 = GUICtrlCreateButton("2", 120, 100, 80, 30)

Local $F3 = GUICtrlCreateButton("3", 200, 100, 80, 30)

Local $F4 = GUICtrlCreateButton("4", 280, 100, 80, 30)

Local $F5 = GUICtrlCreateButton("5", 360, 100, 80, 30)

Local $F6 = GUICtrlCreateButton("6", 440, 100, 80, 30)

Local $F7 = GUICtrlCreateButton("7", 520, 100, 80, 30)

Local $F8 = GUICtrlCreateButton("8", 600, 100, 80, 30)

Local $F9 = GUICtrlCreateButton("9", 680, 100, 80, 30)

Local $F10 = GUICtrlCreateButton("10", 760, 100, 80, 30)

Local $Cancel = GUICtrlCreateButton("Cancel", 840, 100, 80, 30)

thanks in advance

Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16

Link to comment
Share on other sites

When creating the GUI the GUICreate function has as optional parameters the Left and Top settings, this is where you can initially tell the script where on the screen to create the GUI. It defaults to the middle of the screen. If you want to move it after it's created, you can use the WinMove command.

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

Link to comment
Share on other sites

hi brewman

i don't think i outlined my problem properly in my last post, what my problem is, is getting the gui controls properly positioned on the screen.

would you mind editing the code i posted in my last post with the correct coordinates for the gui?

it would be most helpful.

thanks in advance.

Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16

Link to comment
Share on other sites

  • Developers

Hi XY16,

How do you want them to be aligned?

They currently lined up as a strait line a little of centrr towards the right.

ps, are you using Zoomtext or other software while programming to "read" your code?

r/Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

My bet is on 'SuperNova Screen Reader (formerly Hal)' by www.yourdolphin.com . As Zoomtext != screen reader.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

  • Developers

My bet is on 'SuperNova Screen Reader (formerly Hal)' by www.yourdolphin.com . As Zoomtext != screen reader.

You probable talk about a different program, because I can assure you the ZoomText I talk about can read all text from the screen and is used by visual handicapped people. Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Yep, different one. Although the name kinda suggest magnifier type.

(yep, never made it passed HAL in the Wikipedia screen_readers page. lol)

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

XY16

Don't know if your currently working on your homepage.

Just a little detail. (I live for that kinda shit.)

Some 'return' links, with text "Return to the levtec home page" on your pages link to a none existing URL "levtec.webhop.net/levtec.htm".

Had a nice read reading your post history.

Think that's it from me. Dev's and I don't mix that well.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

hi

thanks for the replies.

firstly, i am using supernova screen reader, zoomtext is a pile of s**t smiles

secondly, the problem with the gui is that only the first 3 or 4 buttons are read, so i assume the gui is not properly being displayed on screen (going off screen).

i don't know how the controls should be positioned in order for them all to be visible at the same time, even when the window isn't in a maximized state.

any suggestions and modifications to my code would be greatly appreciated, and i am willing to try out all modifications posted.

once again thank you for your assistance, this forum is the friendliest coders forum i have ever come accross, other forums seem to frown on blind programmers as if it's ilegal for someone like me to write software or something.

Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16

Link to comment
Share on other sites

thanks for the site feedback, i'll find the offending pages and fix them ASAP.

Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16

Link to comment
Share on other sites

Keep kinda neglecting my one own project ... ergo, some code that might be of some use.

* code_start *

;; short notes:

;; - creates a basic gui-window with some buttons(button bar). Orientated in a horizontal or vertical line.

;; - Fully adjustable (see first var-block in GUITest() function), So you can test if/when your screen reader start giving different and or unexpected output.

;; - no status bar part. Seemed not relevant to tester setup.

;~ #AutoIt3Wrapper_Run_Au3Check=y

;~ #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y

;~ #AutoIt3Wrapper_AU3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

GUITest()

_GuiWait()

Exit

;;FUNCTIONS

;;GUITest()

;;_GuiWait()

;;_beep(...)

Func GUITest()

;;variable test settings

Local $iAlign, $iButtons, $iButWidth, $iButHeight, $iButPadding, $iWinPadding

Local Enum $_hor_, $_ver_ ;; 0 and 1, used as BOOL

#forceref $_hor_, $_ver_

$iAlign = $_hor_

$iButtons = 10

$iButWidth = 80

$iButHeight = 30

$iButPadding = 2 ;;space between buttons them self. Takes negative values, making buttons overlap.

$iWinPadding = 10 ;;space between window borders(client space) and the buttons(as group). For both X and Y ax.

;;calculate some additional vars

Local $iWinWidth, $iWinHeight

;;winsize, fits both bar orientations.

$iWinWidth = ($iButtons * $iButWidth) + (($iButtons - 1) * $iButPadding) + $iWinPadding * 2

$iWinHeight = ($iButtons * $iButHeight) + (($iButtons - 1) * $iButPadding) + $iWinPadding * 2

;;general check+feadback for: window posible larger than desktop. (one: hor, two:vertical, three:Both)

If $iWinWidth + 10 > @DesktopWidth Then _Beep(1)

If $iWinWidth + 10 > @DesktopHeight Then _Beep(2)

;;create the gui

GUICreate("ButtonTestGui", $iWinWidth, $iWinHeight)

;create gui buttons

Local $iPosX, $iPosY

For $iBut = 0 To ($iButtons - 1)

If $iAlign Then ;;vertical

$iPosX = $iWinPadding

$iPosY = $iWinPadding + ($iBut * $iButHeight) + ($iBut * $iButPadding)

Else ;;horizontal

$iPosX = $iWinPadding + ($iBut * $iButWidth) + ($iBut * $iButPadding)

$iPosY = $iWinPadding

EndIf

GUICtrlCreateButton(String($iBut + 1), $iPosX, $iPosY, $iButWidth, $iButHeight)

Next

;;finilize gui

GUISetState()

EndFunc

Func _GuiWait()

Do

Until GUIGetMsg() = -3 ;;$GUI_EVENT_CLOSE

EndFunc

Func _Beep($iBeep = 1, $iBeepFreq = 1000, $iBeepDur = 250, $iBeepPad = -1)

If $iBeepPad < 0 Then $iBeepPad = 20 * 5

For $i = 1 To $iBeep

If $iBeepPad Then Sleep($iBeepPad / 2)

Beep($iBeepFreq, $iBeepDur)

If $iBeepPad Then Sleep($iBeepPad / 2)

Next

EndFunc

* code_end *

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

  • Developers

secondly, the problem with the gui is that only the first 3 or 4 buttons are read, so i assume the gui is not properly being displayed on screen (going off screen).

They are allined correctly to fire when clicked.

Maybe post your code that does the Message handling?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

thanks for the code sample. i'll take a look and report back on my progress.

once again, thanks for all you're helpful input.

Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...