Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Agemaniac

MFC topmost dialog

This topic is 5373 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

You are right. i wanna exactly what you have said. but when i use BS_RADIOBUTTON | BS_PUSHLIKE the button appear like a radio button

0 "Some Text"

^
|
black/blank circle that is market when clicked

humm..i really dont know how to explain it better..
thanks..!!

Share this post


Link to post
Share on other sites
Advertisement
Hum..you are right. That works. And now, when i edit the resource from the dialog the properties in the button have the option Push-Like marked. Its strage because the other buttons dont have this option to be marked. Should i change the .rc every time i wanna a button like this?

ps: how do you figure out that changing the rc is the only way. I really "never" would think in something like this


Many thanks!!!

Share this post


Link to post
Share on other sites
I''m used to beating MFC into submission, mostly. After years of it you learn most of the tricks.

VC7 no longer even has a place where you can check the "Pushlike", that I could find. Buttons have always been kind of buggy in their styles.

-fel

Share this post


Link to post
Share on other sites
hum.i figure out what is happening..when i change the .rc by hand the button change to checkbox..soh the Control have changed and the option Push-like appear. i dont know why the buttons in the dialog dont have the options found in a tool bar. I wanna a group of button to behave like the CHECKGROUP_STYLE found in the tool bar buttons, but i think there is no way to do it (by hand perhaps it could work).

like (if A is checked)
uncheck B, C ,D and all others from the group.

i have to go now. we can talk tomorrow..ehehheh..
if u got icq perhaps we can talk dinamically..i really apreciate your help, saves me a lot of time...thanks.!!!!

Share this post


Link to post
Share on other sites
Buttons are groupable just like radio buttons are. Basically the toolbar''s TBSTYLE_CHECKGROUP is an internal set of radio buttons that are grouped and then set pushlike. So, you basically need to set up a group box, set up all your buttons as radio buttons with grouping turned on, then modify the style to pushlike in the manner you did this one, and it should work.

-fel

Share this post


Link to post
Share on other sites
Hi, again..^^
Hum... i did what u have said..but nothing have changed ..the buttons seens to act independent!

hum.i think the "group" is not working in this case, because each button is marked independently. So i cand unmark any of it.. hehehhe

[edited by - Agemaniac on June 4, 2004 11:26:20 AM]

Share this post


Link to post
Share on other sites
Okay, a little about grouping, since looking at my previous comments they were admittedly a tad vague.

Grouping is based on tab order. You need to put your radio buttons in, then you need to set the first button in the tab order, and ONLY the first button in the tab order, to Grouping in its properties (WS_GROUP if you''re doing it manually). If you set them all to group, it will think you want all of them set to make their own group and obviously that won''t work. After you get that set up, then set the pushbutton on all of them, and it should be fine (at least it is in my test version here.)

No, this isn''t the most rational way they could have done it, but it''s how it was done.

-fel

Share this post


Link to post
Share on other sites
Hum..you are right. the Tab order was wrong. And didnt know that just the first from the group must have the group checked.

question: when i open the dialog and for example select one button from the group it is marked. it i click any of the directional key the button marked change to the other button from the group. Is there a way to prevent it? im using the directional key to move the camera in my OpenGL aplication, and i dont wanna it to change the selected button.

Share this post


Link to post
Share on other sites
Yes, but it''s not pretty. You would have to capture the key press and then force the control to ignore it. I believe you can use the NM_KEYDOWN control notification on buttons like this, but, again, it''s been a long time.

-fel

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!