Jump to content

I need help with GUI coordinates and a more attractive visual interface for my programs

Recommended Posts

Cheers to the autoit team,
Before turning to the problem I am having below, I first want to give a little introduction and a few details.
About me: I am a person with total visual impairment, they are also known as blind or blind people. I am blind from birth, but even so that does not mean that I cannot do things like use a computer, much less program, but it is quite the opposite. You can normally use a computer, and this is thanks to screen readers, which are software that allows us to read everything that appears on the screen while we navigate, either with the mouse or the keyboard, so I wanted to give this introduction to that there are no bad images or misunderstandings.
In fact, I have a lot of experience programming in this language, because everything is possible in this life despite its defects, right?
Well now I will talk about my problem:
Some time ago I was already in the most advanced of the language and I wanted to create programs, UDFS, scripts for something specific and I have them all finished now.
The problem is recurrent, especially in GUI (Graphical User Interface) controls where the coordinates in each of the GUI controls are displayed incorrectly on the screen, taking into account that I also have experience in terms of xy coordinates, I am guided by that with a physical Cartesian plane and I have more or less the creativity of the form and the positions, but I think that on the screen it is different. To explain more, these controls are displayed in an unpleasant way, and I say this because I installed one of my programs on a computer of a relative who was a sighted person, I had tried to teach it but there were, for example, incomplete tables, the text of misplaced controls and so on. Due to my bad luck, my screen reader reads everything well to me, in fact when I navigate the interface it seems great and everything is fine, but the problem is only the location of the controls on the screen.
I applied the GuiCoordMode option and everything remained the same, and I need your help with this, and if possible, if you could explain a little more to me what I am failing or in what coordinate each control should be placed.
I think the only way to help me would be through GitHub, at least I don't think I will find another option. In it I have the code of most of my programs and I await your help. I accept pull requests, as long as it does not affect or alter the code and the operation of the program.

My GitHub:


Edited by Mateocedillo
Link to post
Share on other sites

Hello @Mateocedillo first let me tell you that you're amazing.  I try to think how you solve programming task and problem,  It makes my brain collapse. 

It's very hard to help due to we probably don't share same perspective of the things.  But I'll try to help you with a small explanation of the option Opt("GUICoordMode", 2) usage.


#include <GUIConstantsEx.au3>


Func Example()
    Opt("GUICoordMode", 2) ;relative to cell mode

    GUICreate("My GUI Set Coord")
;~  GUISetCoord(0, 0) ;this is default position start at 0,0 left top corner for that reason It's commented maybe not needed at this point
    ;Imagine this as table of cell (we add 3 checkboxes one on the right side of the other) in the first imaginary row
    GUICtrlCreateCheckbox("Checkbox #1", 20, 10) ;at position 0,0  we Add checkbox1 - parameter 20 means x position  and 10 means y position, both relative to GUISetCoord setted
    GUICtrlCreateCheckbox("Checkbox #2", 10, -1) ;at position 0,1 we add CheckBox2 - parameter 10 means space in pixel between last control and new one, parameter -1 means add in same y position like my last control
    GUICtrlCreateCheckbox("Checkbox #3", 10, -1) ;at position 0,2  we add CheckBox3 - parameter 10 means space in pixel between last control and new one, parameter -1 means add in same y position like my last control
    GUISetCoord(20, 60) ;this defines where my other rwo will start 20 means the x relative position and 60 my y relative postion.
    ;very important y position to avoid new controls over last added control try to set to a value greater than the sum of the height or the last controls. like we added just one row before, it will be ok height of a checkbox plus a number of pixel for separate let's say checkbox height was 20 and we sum 40 as space between last rwo and new one
    ;lets add two button one on the right side of the other
    GUICtrlCreateButton("OK #1", -1, -1) ;at position 0,0 first parameter -1 means default x position previous defined by GUISetCoord it was 20, second parameter means default y position defined by GUISetCoord it was 60
    GUICtrlCreateButton("Cancel #2", 10, -1);at position 0,1 first parameter 10 means 10 space between last button and new one and parameter -1 mean keep y position
    GUISetState(@SW_SHOW) ; will display an empty dialog box

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE


EndFunc   ;==>Example


I hope it helps you.

I speak Spanish too so  Maybe I could help you by private message or maybe I could add you in WhatsApp. Send me private message.



Link to post
Share on other sites
  • 4 weeks later...

hi @Danyfirex
The explanation has left me a bit clear and more or less I get an idea of the visual way in which the GUI controls can be located, but I really do not get along with the GuiCoordMode if I do not directly give the coordinates directly to the control, for example GuiCtrlCreateButton ("test", 10, 0, 20, 20)
I would like us to contact each other more often to talk about this, since I really need help from sighted programmers, because I am a person with a disability as I had emphasized in my first message and only with the graphical visual interface is the problem.


Edited by Mateocedillo
can't mark @username as mention.
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...