[GUI] Grid selection GUI

Post your working scripts, libraries and tools
DigiDon
Posts: 175
Joined: 19 May 2014, 04:55
Contact:

[GUI] Grid selection GUI

10 Feb 2018, 05:30

Hi,

I asked in Help if it was done before but didn't get any reply Grid GUI to select table size (row & column number) so I've worked on it from scratch.

Here is what I wanted to achieve (taken from Word insert table feature)
Image

And after several tries I'm pretty happy with the result! :)
The hardest part was to maximize speed and avoid flickering.

FIRST VERSION with images (handles)
Here are the button images I used
ButtonOn.png
Image and
ButtonOff.png
Image

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Here is another version with progress bar so without images (faster indeed it seems !) (thanks tidbit)

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



More complex class from tidbit
Allosw multiple anchor points etc.
Image

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Enjoy! ;)
Last edited by DigiDon on 12 Feb 2018, 06:13, edited 5 times in total.
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic

Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
User avatar
tidbit
Posts: 1084
Joined: 29 Sep 2013, 17:15
Location: USA

Re: [GUI] Grid selection GUI

10 Feb 2018, 11:54

Sorry I didn't see your topic sooner :P I too made one of these a while ago. allows any anchor point and uses progress bars instead of images. various output styles. quite handy. But congrats. bet you learned a few things :)

simple demo and class: https://pastebin.com/raw/pHFmB4WR (thought I released it on the forums. can't find the page o_O oh well)
Image
(12 fps gif. it flickers more than IRL)
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
DigiDon
Posts: 175
Joined: 19 May 2014, 04:55
Contact:

Re: [GUI] Grid selection GUI

10 Feb 2018, 12:11

Ahah cool that I wasn't alone and unfortunate I couldn't see that before starting.

Well the code is for me a bit complex to understand but using progress bar is really a smart trick I didn't think of and the result looks pretty nice.
Could you elaborate a bit on the king of tricks you relied on?

You have as many progress bar as cases and then you set them at 100 when you want to fill them? Are the edit fields used? Any other fields?

How did you handle gaps Im' not sure I understood?
For me I had to overlap by 1px the images so that there would be no blanks.
I tried to put a fake image control underneath it but it didn't seem to work (A_GuiControl was empty)

PS : what do you use to make the GIF? :P
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic

Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
User avatar
tidbit
Posts: 1084
Joined: 29 Sep 2013, 17:15
Location: USA

Re: [GUI] Grid selection GUI

10 Feb 2018, 12:32

the Edit controls are commented out (thus the ; ) , I used them for testing to see values instead of progress bars
there is one edit field that is used, and that's to display the selection info.

progresses start out as 0, "empty" to make it look unselected. (I tried adding a fancy effect, it kinda worked, but not really)
then use mousegetpos to find which control is under the mouse.
depending on the anchor point, we fill in the grid between the mouse and anchor by setting the Progresses to 100

gaps are just a simple math. Offset the next tiles xposition and yposition by the gap size
ImageImage
(gap of 20)

gif made using LICEcap
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
DigiDon
Posts: 175
Joined: 19 May 2014, 04:55
Contact:

Re: [GUI] Grid selection GUI

10 Feb 2018, 12:46

By gaps handling I was meaning that in my case if the mouse went out of the grid A_GuiControl is empty and so I was clearing the grid.
However with gaps I had also A_GuiControl empty and so clearing was not good.

So I had to overlap so there would be no Empty A_GuiControl var if not ouside the grid.

I tried to put an invisible control all over the grid so that I could still have gaps but could not find any really invisible control.
Do you know any?
What was your solution?
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic

Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
User avatar
tidbit
Posts: 1084
Joined: 29 Sep 2013, 17:15
Location: USA

Re: [GUI] Grid selection GUI

10 Feb 2018, 13:11

oh, for gaps that doesn't matter with mousegetpos. I store the selection whenever one is hovered, so if it goes out of a tile, it still has the last saved selection.

but you could maybe do something like..

Code: [Select all] [Download] GeSHi © Codebox Plus

if (A_GuiControl="")
return ; or something else. "don't do anything if nothing is selected"
.. or ..
if (A_GuiControl="")
selectedTile:=previousSelectedTile
; somehow save the last selected and the current selected. if current is blank, save the last non-blank one.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
DigiDon
Posts: 175
Joined: 19 May 2014, 04:55
Contact:

Re: [GUI] Grid selection GUI

10 Feb 2018, 13:21

Yes but I wanted to distinguish going out of the tile vs going out of the grid (but might be still in the grid GUI).

But I've finally found an invisible control I was looking for!

So thanks to you my friend ;)
here is another version with progress bar (faster indeed it seems !)

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by DigiDon on 11 Feb 2018, 04:08, edited 1 time in total.
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic

Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:
guest3456
Posts: 2359
Joined: 09 Oct 2013, 10:31

Re: [GUI] Grid selection GUI

10 Feb 2018, 14:02

well done

DigiDon
Posts: 175
Joined: 19 May 2014, 04:55
Contact:

Re: [GUI] Grid selection GUI

11 Feb 2018, 04:05

guest3456 wrote:well done


Thanks ! ;)
EverFastAccess : Take Notes on anything the Fast way: Attach notes, Set reminders & Speed up research in 1 gesture - AHK topic
AHK Dynamic Obfuscator L - Protect your AHK code by Obfuscation - AHK topic
QuickModules for Outlook : Sort Outlook emails very quickly to multiple folders - AHK topic

Coding takes lots of time and efforts. If I have helped you or if you enjoy one of my free projects, please consider a small donation :thumbup:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 20 guests