SetFocus (UnSetFocus?) question

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

SetFocus (UnSetFocus?) question

Post by CalScot »

I have a main menu made of several buttons. If one is clicked that has a submenu, the main menu buttons are disabled and turn grey, and the focus moves to the menu buttons on the submenu. But if the click triggers a process, it opens a window in which labels become visible as the process and the ProgressBar move along - but the menu buttons don't go grey and lose focus until a "Done" button at the end of the process becomes visible and gets focus.
I've tried setting the focus to the process update window, and focus can't be set to the Labels or to the ProgressBar or (it seems) to anything else that doesn't interrupt the process. I've even tried doing SetFocus to the "Done" button before it's made visible (as soon as I load the process window), but that doesn't seem to work either.
It doesn't affect the logic or the process itself, but it would look better if I could grey the menu buttons as soon as they're disabled.
Is there a way to "UnSetFocus"? I hope that I'm not missing anything obvious, but it's got me stumped. Any ideas or suggestions would be appreciated.
Thanks.
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Re: SetFocus (UnSetFocus?) question

Post by vagblad »

I am not sure if i understood that correctly, but you can try and insert a DO EVENTS at the start of the so called process.If it is a loop then just inside the loop.That would force any event including the setfocus one to trigger.

Maybe a small screenshot of whats happening would help to understand the problem a bit more.
Hope it helps!
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: SetFocus (UnSetFocus?) question

Post by CalScot »

Thanks for the suggestion, Vagblad - I appreciate it.
DO EVENTS seems to have the same issue - that the buttons won't turn grey without interrupting and stopping the process with a new focus.
I'm leaving town in a few days and will be gone for a few weeks, and things are a bit hectic, but I will try to upload a small sample before I go.
Thanks again.
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: SetFocus (UnSetFocus?) question

Post by CalScot »

CSTest.rar
(4.6 KiB) Downloaded 145 times
Here's a sample version showing the problem I've described.
If anyone can help or point out what I'm doing wrong, I'd appreciate it.
Thanks!
User avatar
koke
Posts: 116
Joined: Wed Aug 21, 2013 3:54 pm
DBs Used: DBF, mySql, mariaDB

Re: SetFocus (UnSetFocus?) question

Post by koke »

Hi.
CalScot i try your sample and it works fine which version of HMG are you using, i compile in 3.4.3 and it tuns gray when i press the button and the progress bar starts running.
,___,
[O.o]
/)__)
-”–”-
KoKe
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: SetFocus (UnSetFocus?) question

Post by CalScot »

Hi, koke.
Thanks for testing it and for your reply.
I'm using 3.4.3, 32-bit build, under Win 10.
I just copied the CS.exe sample to an old machine running XP and it works perfectly, but on the two Win 10 machines I've tried it on, I get the problem I've described, so maybe it's a Win 10 issue rather that a coding issue? I have no idea what setting(s) could cause that! Strange!
I'm obviously going to have to do some more research when I get back from my trip!
Thanks again.
User avatar
koke
Posts: 116
Joined: Wed Aug 21, 2013 3:54 pm
DBs Used: DBF, mySql, mariaDB

Re: SetFocus (UnSetFocus?) question

Post by koke »

Hi,
Try installing all the updates for yous OS because its working fine on my windows 10 32bits
,___,
[O.o]
/)__)
-”–”-
KoKe
Post Reply