flat assembler
Message board for the users of flat assembler.

Index > Windows > Button styles

Author
Thread Post new topic Reply to topic
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
Hi!

Im sorry this isnt directly a fasm question..
But i am using PureBasic to program in [wich is using fasm to compile!]

I often see a lot of assembler programs that have such Light buttons or "RaiseWhenMouse over" buttons.
http://www.anorak.nm.ru/ <-- Look at Crack Tricle. 100% asm.
It has such special buttons and controls..


How do i make those buttons? With PB i can use api flags on GadGets[controls]
but how do i make them look like that?

Merry Xmas!
Daniel
Post 19 Dec 2004, 09:12
View user's profile Send private message Reply with quote
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
No one knowS?
Post 19 Dec 2004, 13:58
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
It is not too simple thing. You have several ways to do the job.
One possible approach is to use ownerdraw buttons and to repaint them on WM_MOUSEMOVE. Also, creating your own control can be one clear solution.
Also, subclassing standard button will work.
Simple solution is to set and clear BS_FLAT button style.

Possible problem is that you can't exactly determine the moment when the mouse goes outside the button. Solution:

On WM_MOUSEMOVE -> if "GetCapture" is not in your button, then the mouse just enters the button -> repaint it as active and "SetCapture" to the button.
If on WM_MOUSEMOVE the "GetCapture" is to the button, then check is the cursor in or outside the button -> if the cursor is outside: repaint as inactive and "SetCapture NULL".

Well, I hope it is at least a little clear. Smile

...OK, I created simple example for such button. You will need Fresh 1.1.B or later to compile it. It uses automatic subclassing features of Fresh standard library and BS_FLAT approach described above.

Regards.


Description: Hot button example.
Download
Filename: HotButton.zip
Filesize: 3.96 KB
Downloaded: 242 Time(s)

Post 19 Dec 2004, 15:10
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
Thanks Very Happy

So actually i have to let the button be FLAT when no mouse on it, and normal when mouse is on?
Post 19 Dec 2004, 18:51
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
thefool wrote:
So actually i have to let the button be FLAT when no mouse on it, and normal when mouse is on?


This is the most simple idea... though you can't create more "dashing" design this way...

Regards
Post 19 Dec 2004, 19:02
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
I know, but its still a bit nice..!
Anyway to remove the border around a flat button?
Post 19 Dec 2004, 19:58
View user's profile Send private message Reply with quote
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
This was one way to do it.
Anyone knows about other ways?
Post 20 Dec 2004, 15:06
View user's profile Send private message Reply with quote
thefool



Joined: 13 Jul 2004
Posts: 13
Location: Denmark
thefool
anyone?
Post 22 Dec 2004, 11:15
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
google? Wink
Post 22 Dec 2004, 12:12
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Win2000 has these buttons as standard - check your explorer or Mozilla window or QuickLaunch icons or whatever - they are everywhere. Very Happy
Post 22 Dec 2004, 15:48
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Madis731 wrote:
Win2000 has these buttons as standard - check your explorer or Mozilla window or QuickLaunch icons or whatever - they are everywhere. Very Happy


No, all these buttons are not stand alone controls, but they are members of toolbar contol and every Windows, not only Win200 have such behaviour for toolbar buttons.

Regards.
Post 22 Dec 2004, 16:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
oh ok :$ shame on me - RTFM
Post 23 Dec 2004, 14:58
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.