News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

New TextButton example with multiple image backgrounds.

Started by hutch--, January 22, 2018, 06:22:44 PM

Previous topic - Next topic

hutch--

I removed the earlier ones as they were only taking up space. This version is complete and displays the text buttons properly and the test app will display 3 different background images in the client area. You could do many more but I did not want the file to end up too large.

You can set a TTF font of your choice and make the display area of each button at whatever size you require. The text can be changed and you can set the alignment of the text using the normal DrawText options. The fixed arguments, handle, instance and 4 colours are set in a structure to keep the argument count down and you can only use a single set of 4 colours for the application as mixed button colours usually look terrible on an interface.

At some later point I will put the code for the text button into a library module so its easier to use.

LiaoMi

Hi hutch,

thanks for the interesting example, I have a very fast mouse, so when I quickly go through the first three buttons, in the middle button there are black bars, because of this, it is felt that the button is flickering. If the mouse is within one button, this flicker reappears, someone else might have noticed this effect ?!  :icon_eek:

hutch--

What happens if you just drag the mouse slowly up or down the buttons ? It sounds like with the mouse set very fast that each control is missing out on some of the internal messages. I tried doing the same with my own mouse movements which are also fast and I got one sweep that left one of the button showing red text but passing the mouse back over the buttons brought it back to normal.

It may be an effect of some lag in the TrackMouseEvent code. I just tried putting the InvalidateRect call after the TrackMouseEvent call but it made no difference.

LiaoMi

The same thing happens, sometimes even with very slow movement. The flicker is noticeably clearer, if you move the mouse only horizontally, sometimes the whole text blinks.

hutch--

I am using Win10 64 pro and the machine is a 3.3 gig Haswell E/EP. What OS and processor are you using ?

I just tested in on my Win7 64 Ultimate box which is an old 2.8 gig i7 and it works perfectly so I don't know what is going on with the results you mentioned.

The Win10 box is using a corded Microsoft mouse, the old i7 is using a Logitech cordless mouse and both are set up with fast mouse settings.

LiaoMi

I have win 10 ent, the last build, intel i7-4810mq processor. I'll try on other machines and share the results  :P

Magnum

Quote from: hutch-- on January 22, 2018, 06:22:44 PM
I removed the earlier ones as they were only taking up space. This version is complete and displays the text buttons properly and the test app will display 3 different background images in the client area. You could do many more but I did not want the file to end up too large.

You can set a TTF font of your choice and make the display area of each button at whatever size you require. The text can be changed and you can set the alignment of the text using the normal DrawText options. The fixed arguments, handle, instance and 4 colours are set in a structure to keep the argument count down and you can only use a single set of 4 colours for the application as mixed button colours usually look terrible on an interface.

At some later point I will put the code for the text button into a library module so its easier to use.

Works well in Ubuntu Mate 16.04.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org