Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Window Class Reference

A frame with min. More...

#include <vcf/ApplicationKit/Window.h>

Inheritance diagram for VCF::Window:

VCF::Frame VCF::Control VCF::DelegatedContainer< Frame > VCF::UIComponent VCF::AbstractView VCF::Component VCF::View VCF::ObjectWithCallbacks VCF::Object VCF::Toolbar::FloatingToolbar List of all members.

Public Types

enum  WindowEvents { weRestore }

Public Member Functions

 Window ()
 Window (Control *control)
virtual ~Window ()
virtual WindowMinimize void setCaption (const String &caption)
 Sets the caption for the frame.
virtual void paint (GraphicsContext *context)
 Paints the control.
virtual void resizeChildren (Control *control)
 overridden to take into account client bounds
virtual Rect getClientBounds (const bool &includeBorder=true)
 returns the client bounds of a window.
virtual void setClientBounds (Rect *bounds)
 Sets the client bounds only.
MenuBargetMenuBar ()
 Returns the menu bar for the window.
void setMenuBar (MenuBar *menuBar)
 Sets the menu bar for the window.
virtual void beforeDestroy (ComponentEvent *event)
 called just prior to completely destroying the control and it's associated memory.
virtual void close ()
 Closes the Frame.
virtual void setFrameStyle (const FrameStyleType &frameStyle)
 Sets the frame style @ see FrameStyleType.
virtual void setFrameTopmost (const bool &isTopmost)
 Makes this frame a topmost floating window.
virtual double getPreferredWidth ()
 returns the preferred width for this control.
virtual double getPreferredHeight ()
 returns the preferred height for this control.
bool isMaximized ()
 indicates whether or not the window is maximized.
void setMaximized (const bool maximized)
 Sets whether or not the window is maximized.
bool isMinimized ()
 returns whether or not teh window is minimized
void setMinimized (const bool &minimized)
 Sets whether or not the window is minimized.
void restore ()
 restores the window to it's original position prior to being minimized or maximized.
virtual bool allowsActivation ()
 Indicates to the framework whether or not this frame should allow activation.
virtual void setIconImage (Image *icon)
 Sets the icon image.
virtual ImagegetIconImage ()
 Returns the current image for the frames icon.
virtual bool isActiveFrame ()
virtual void setBorderPath (Path *path)
 modifies the border of the frame to follow the series of points contained in the path.
void handleEvent (Event *event)
 This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc.

Public Attributes

VCF::Delegate WindowDelegate
WindowRestore VCF::Delegate WindowDelegate
WindowMaximize VCF::Delegate WindowDelegate

Protected Member Functions

void postClose (Event *event)
void onClose (FrameEvent *e)
virtual void destroy ()
 called by the free() method.

Protected Attributes

WindowPeerwindowPeer_
MenuBarmenuBar_

Detailed Description

A frame with min.

max, restore, and system buttons. Has a caption of the standard height.

Event Delegates for this class:
  • Window::WindowRestore
  • Window::WindowMaximize
  • Window::WindowMinimize


Member Enumeration Documentation

enum VCF::Window::WindowEvents
 

Enumerator:
weRestore 


Constructor & Destructor Documentation

VCF::Window::Window  ) 
 

VCF::Window::Window Control control  ) 
 

virtual VCF::Window::~Window  )  [virtual]
 


Member Function Documentation

virtual bool VCF::Window::allowsActivation  )  [inline, virtual]
 

Indicates to the framework whether or not this frame should allow activation.

Som frames do not support becoming activated, for example the tooltip frame, or the frame that houses the dropdown list for the ComboBoxControl. Must be implemented by derived classes.

Implements VCF::Frame.

virtual void VCF::Window::beforeDestroy ComponentEvent event  )  [virtual]
 

called just prior to completely destroying the control and it's associated memory.

See also:
Component::beforeDestroy()

Reimplemented from VCF::Control.

virtual void VCF::Window::close  )  [virtual]
 

Closes the Frame.

Must be implemented by classes that derive from Frame.

Implements VCF::Frame.

virtual void VCF::Window::destroy  )  [protected, virtual]
 

called by the free() method.

Should be overriden and any clean up code performed here

Reimplemented from VCF::Frame.

virtual Rect VCF::Window::getClientBounds const bool &  includeBorder = true  )  [virtual]
 

returns the client bounds of a window.

This excludes the areas such as the nonclient border, the caption bar, etc.

Reimplemented from VCF::Control.

virtual Image* VCF::Window::getIconImage  )  [virtual]
 

Returns the current image for the frames icon.

Implements VCF::Frame.

MenuBar* VCF::Window::getMenuBar  ) 
 

Returns the menu bar for the window.

While this is partially dependent on how the underlying windowing system implements menu bars, in general (at least on Win32 and most X11 window managers) the menu bar is attached to the window, and displayed directly under the caption bar. It is not considered part of the client region. By default, a newly created window has no menu bar.

Returns:
MenuBar the menu bar of the window, may be NULL.

virtual double VCF::Window::getPreferredHeight  )  [virtual]
 

returns the preferred height for this control.

This is used when determing the height of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

virtual double VCF::Window::getPreferredWidth  )  [virtual]
 

returns the preferred width for this control.

This is used when determing the width of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

void VCF::Window::handleEvent Event event  )  [virtual]
 

This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc.

Once inside the event the Control determines the type, and behaves accordingly, as well as notifying any appropriate listeners.

Reimplemented from VCF::Control.

virtual bool VCF::Window::isActiveFrame  )  [virtual]
 

Implements VCF::Frame.

bool VCF::Window::isMaximized  ) 
 

indicates whether or not the window is maximized.

Returns:
bool true if the window is minimized, otherwise it is false.

bool VCF::Window::isMinimized  ) 
 

returns whether or not teh window is minimized

Returns:
bool true if the window is minimized, otherwise false.

void VCF::Window::onClose FrameEvent e  )  [protected]
 

virtual void VCF::Window::paint GraphicsContext context  )  [virtual]
 

Paints the control.

Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method.

If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly.

Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.

See also:
getAllowPaintNotification

Reimplemented from VCF::Frame.

void VCF::Window::postClose Event event  )  [protected]
 

virtual void VCF::Window::resizeChildren Control control  )  [virtual]
 

overridden to take into account client bounds

Reimplemented from VCF::DelegatedContainer< Frame >.

void VCF::Window::restore  ) 
 

restores the window to it's original position prior to being minimized or maximized.

virtual void VCF::Window::setBorderPath Path path  )  [virtual]
 

modifies the border of the frame to follow the series of points contained in the path.

Reimplemented from VCF::Frame.

virtual WindowMinimize void VCF::Window::setCaption const String caption  )  [virtual]
 

Sets the caption for the frame.

While the exact effects of calling this method depend on windowing system the VCF is running on, in general a caption is displayed on the top of the frame, and is generally a non client area. This method will change the text that is displayed there.

Parameters:
String the new caption to display in the Frame's caption area.

Reimplemented from VCF::Frame.

virtual void VCF::Window::setClientBounds Rect bounds  )  [virtual]
 

Sets the client bounds only.

Implements VCF::Frame.

virtual void VCF::Window::setFrameStyle const FrameStyleType frameStyle  )  [virtual]
 

Sets the frame style @ see FrameStyleType.

Implements VCF::Frame.

virtual void VCF::Window::setFrameTopmost const bool &  isTopmost  )  [virtual]
 

Makes this frame a topmost floating window.

This is typically used for frames that want to behave like toolbars.

Reimplemented from VCF::Frame.

virtual void VCF::Window::setIconImage Image icon  )  [virtual]
 

Sets the icon image.

The behaviour of this is partially windowing system dependent, and some systems (Mac OSX, for example, or some X11 window managers) may choose to ignore this. However, typically the icon is displayed in the top left corner of the frame, in the non client area that houses the caption.

Implements VCF::Frame.

void VCF::Window::setMaximized const bool  maximized  ) 
 

Sets whether or not the window is maximized.

void VCF::Window::setMenuBar MenuBar menuBar  ) 
 

Sets the menu bar for the window.

Note, that this currently does not add the menuBar as a component of the window.

void VCF::Window::setMinimized const bool &  minimized  ) 
 

Sets whether or not the window is minimized.


Member Data Documentation

MenuBar* VCF::Window::menuBar_ [protected]
 

WindowMaximize VCF::Delegate VCF::Window::WindowDelegate
 

Event Delegate:
WindowMinimize this is fired when the window is minimized. This event is generated by the underlying windowing system.
event class: WindowEvent
event type: WINDOW_EVENT_MINIMIZE

Reimplemented from VCF::Frame.

WindowRestore VCF::Delegate VCF::Window::WindowDelegate
 

Event Delegate:
WindowMaximize this is fired when the window is maximized. This event is generated by the underlying windowing system.
event class: WindowEvent
event type: WINDOW_EVENT_MAXIMIZE

Reimplemented from VCF::Frame.

VCF::Delegate VCF::Window::WindowDelegate
 

Event Delegate:
WindowRestore this is fired when the window is restored back to it's original position. This event is generated by the underlying windowing system.
event class: WindowEvent
event type: WINDOW_EVENT_RESTORE

Reimplemented from VCF::Frame.

WindowPeer* VCF::Window::windowPeer_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information