View Full Version : Three ClanGUI window questions

01-03-2014, 08:45 PM
Is there a way to create a window without minimize, maximize, and close buttons?

Is there a way to disable (grey out) or relocate the minimize, maximize, and close buttons?

Is there a way to create a modal dialog/window?

01-05-2014, 09:33 AM
I guess that you are using the system GUI window manager

When you contruct the root window, the constructor can take GUITopLevelDescription as a parameter. This is a typedef to DisplayWindowDescription ( http://clanlib.org/documentation/3.0/classclan_1_1DisplayWindowDescription.html )

I don't know about model/dialog windows in clanGUI ... it might be possible, but since i've not encoutered it, it's unlikely.

01-06-2014, 05:44 PM
I am using GUITexture. I tried using GUITopLevelDescription, but "show_minimize()" and "show_maximize()" don't seem to affect the window. Perhaps GUITexture has different functionality from GUISystem.

As far as the modal dialog, ClanLib does have a, "message_box" component. I'll give that a try.

01-06-2014, 09:38 PM
GUI System Window Manager : Draws directly onto the window when a component requires redrawing. This is event driven. It responds to the operating system "paint" messages. Only clanGUI controls this window.
GUI Texture Window Manager : Draws the GUI onto a texture. The texture is only written to when a component changes. The texture is then drawn onto the window (either manually or automatically)
GUI Direct Window Manager: Draws the GUI directly to a window. This entire GUI is drawn on every paint call (even if the component does not change)

So with the Texture Window Manager, use DisplayWindowDescription when creating the DisplayWindow (as a parameter), before GUIWindowManagerTexture is constructed

(As far as I know, I don't use clanGUI)

01-06-2014, 10:14 PM
I think that we might be thinking about different things, perhaps I did a poor job of communicating it before.

I want to create windows within my main application window. (I'm not concerned with the functionality of the main window itself) I am curious if ClanLib supports minimize/maximize functionality on windows inside of the main window, and if I can enable/disable the minimize, maximize, and close icons of those windows.

If not, for my purposes, I will probably have to create a frame element with pushbuttons for min/max/close and handle that functionality myself.

01-07-2014, 08:21 AM
Ah sorry.

No clanGUI currently does not support that.

If you WANT minimise/maximise, you would have to copy the clanGUI's clan::Window code, and create your own component containing the minimise/maximise functionality.

If you don't want minimise/maximise/close, there are various options:
1) Change the clan::Window CSS, removing the close button
2) Copy the clan::Window code, removing the close button code
3) Don't use clan::Window, if the window is not draggable, instead use clan::GUIComponent
4) Don't use clan::Window, if the window is draggable without a caption bar, use clan::DragBox