Jump to content

Creating a label with a negative position.


Recommended Posts

Hi all,

I'm having an odd issue, i am using melba's scroll bars here and When a control goes under the "seen" area it doesnt get drawn at all.

Here is the snippet of code where it happens showing how i calculate the position for the redraw as well.

$scrtemp = _GUIScrollbars_Locate_Ctrl($SCARMAIN, 0, 80)
$DYNA[0] = Guictrlcreatelabel($SCARDATA[0][7], 110, $scrtemp[1], 400, 100) ;supplier
GUICtrlSetFont(-1 ,10 , 400, 0, "Arial")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

Now when i get the label with a calculated position of around -1.something it just doesnt draw the label. I just tried to make it go further past -1 and it does draw when this happens.

Is there a way around this? or should i just convert -1 to -2 beforehand?

Thanks!

Link to post
Share on other sites
  • Moderators

DarkestHour,

The Help file for GUICtrlCreateLabel states that if you use -1 as a position value AutoIt moves into GUICoordMode computation - so I would think the label is being created, but that it is not located where you think it should be. The fact that you seem to say that -2 does work only reinforces this idea. So your idea of making sure that the value is never set to -1 seems like a good solution - try it and let us know if it works. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to post
Share on other sites

Sorry Mono, I had thought that this was more theoretical then really broken thus the short snippet, in the future i will include a full running script snippet.

Melba, yeah, just setting it to -2 if it falls between -1.99999etc and -1.0 works, only makes the labels a tiny tiny bit off but it is not an issue for this particular gui, thanks!

Link to post
Share on other sites

Sorry Mono, I had thought that this was more theoretical then really broken thus the short snippet, in the future i will include a full running script snippet.

Is not big problem but sometimes i´m not in the mood to create a new script for every issue that i found in this forum, and i think that the person who request the support may post something that make us easy help others. i`m glad you find your answer and i see you around when you have some script problem.
Link to post
Share on other sites
  • Moderators

DarkestHour,

Glad my suggestion worked. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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