News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Tap Control example without Resource file.

Started by Bill Cravener, September 14, 2011, 04:49:51 PM

Previous topic - Next topic

Bill Cravener

Last weekend I had some free time to play around with my love of Masm32 programming and though I've done up a nice example before using Windows common controls (called Controls.zip) available on my examples page I've never done up an example using Windows Tab control. Anyway, here is my example of using Tab Controls without using a Resource file. I've only tested it on Vista so how it works on other OS versions I don't know, there should be no problems though. It was a lot of fun to create, hope you enjoy it!!

http://www.quickersoft.com/examples/Tabs.zip

Or it can be downloaded from my site link below.
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

Vortex

#1
Hi Bill,

Your example works fine on my XP Sp3.

Bill Cravener

My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

jj2007


Bill Cravener

My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

FORTRANS

Hi,

   Win 98 and WinXP looks good.  Win 2000 some text is
truncated and little arrow buttons to access all three tabs, as
if they were too big to show alll three.

Regards,

Steve N.

Bill Cravener

Hi Steve N,

Yep, seems to have a great deal to do with which COMCTL32 version and which Service Pack for that OS is installed. Here's an interesting link about the many versions of Windows COMCTL32 versions.  :wink

http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/comctl32/history/index.htm
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

MichaelW

Under Windows 2000 with my normal Large Fonts (120dpi) setting, the appearance is as Steve described. If I switch to Small Fonts (96dpi), then everything looks OK, with the buttons and associated labels centered on the tabs.

One problem that I did notice is that the radio buttons and check boxes do not reflect the checked state. Switching to the BS_AUTORADIOBUTTON and BS_AUTOCHECKBOX styles should correct these problems without requiring any additional code.

Now pardon me while I restart my system with a font size that I can read without my spectacles :lol
eschew obfuscation

hutch--

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

sounds to me like a case for SystemParametersInfo(NONCLIENTMETRICS)
you can get the correct font, select it into a DC, then GetTextExtentPoint32 (or whatever is applicable) to size the tabs
not sure if that is the "message font" or the "small caption" font   :P
(probably the later)

other than that, it looks great, as always, Bill   :U

ToutEnMasm


Good sample
Just miss a proc to play with the position of the tab (upper lower and so own).
Some buttons can be used for this task instead off show a messagebox.

Bill Cravener

Thanks everyone. Yes when it comes to using larger fonts you would need to adjust window sizes, that and button states I'll leave up to others to deal with.

Getting and Setting button states is easily handled under the WM_COMMAND message for each radio button or check box button. You will generally set the state of one button in a group to checked by default until another in the group is clicked on.

BM_SETCHECK - Sets the check state for radio buttons and check boxes. BM_GETCHECK - Returns the check state of radio buttons and check boxes.

In my tabs example -  invoke SendMessage,hButton1,BM_SETCHECK,1,0 will check the state of button1, and - invoke SendMessage,hButton1,BM_SETCHECK,0,0 will uncheck the state of button1.

Nothing to it! :bg
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

Ramon Sala

Also works fine on my Windows 7 Home Premium.  :U
Greetings from Catalonia

Bill Cravener

Quote from: Ramon Sala on September 15, 2011, 05:31:54 PM
Also works fine on my Windows 7 Home Premium.  :U

Thanks Ramon, I was wondering about that. :bg
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

xandaz

   works fine Bill. Have a look at mine. It was done a while back and has no comments. I'm not sure i ever posted it.