Hiding minimize/maximize buttons in a frame's title bar?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Hiding minimize/maximize buttons in a frame's title bar?

Post by Vexator » Sun Jan 30, 2005 2:55 pm

this is probably an easy thing, but i don't get it.. using wxDEFAULT_FRAME_STYLE &(wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX) doesn't work either. so is there a way just to show the x-button in the title bar of a frame?
i'm on winxp, using wx2.4.2..
thx in advance.

geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

Post by geon » Sun Jan 30, 2005 6:36 pm

You are not supposed to use the flags like that. There should only be '|'s separating the flags, no '('s, ')'s or '&'s.

Reason:
Each flag (ex: wxMAXIMIZE_BOX) has only one bit set. Like 0010. Another flag might be 0001. The '|'-symol is a bitwise or operator. That means the result of 0100|0001 is 0101. This way one can easily set several bits in a single function call.

Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator » Sun Jan 30, 2005 9:06 pm

mh oke.. this was a snippet from the docs so i thought it should work.. but even if i do not use any flag the buttons appear.. is there a way to explicitly deactivate them?

eco
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 203
Joined: Tue Aug 31, 2004 7:06 pm
Location: Behind a can of Mountain Dew
Contact:

Post by eco » Sun Jan 30, 2005 10:18 pm

You can just use all the flags you do want that make up wxDEFAULT_FRAME_STYLE (e.g. "wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN") or you can use AND the ONE'S COMPLIMENT to remove them from the style (e.g. "wxDEFAULT_FRAME_STYLE & (~wxMINIMIZE_BOX) & (~wxMAXIMIZE_BOX)").

Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

Post by Vexator » Mon Jan 31, 2005 12:18 pm

jap that works. thx :D

Post Reply