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

VCF::Frame Class Reference

A frame is a component that houses other components, plus has special adornments used for interacting with it. More...

#include <vcf/ApplicationKit/Frame.h>

Inheritance diagram for VCF::Frame:

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

Public Types

enum  FrameEventTypes { ACTIVATION_EVENT = CUSTOM_EVENT_TYPES + WINDOW_CONST + 6, CLOSE_EVENT = CUSTOM_EVENT_TYPES + WINDOW_CONST + 7, CLOSING_EVENT = CUSTOM_EVENT_TYPES + WINDOW_CONST + 8 }

Public Member Functions

 Frame ()
virtual ~Frame ()
virtual void setCaption (const String &caption)
 Sets the caption for the frame.
virtual String getCaption ()
 The current text of the Frame's caption.
virtual void setClientBounds (Rect *bounds)=0
 Sets the client bounds only.
virtual void paint (GraphicsContext *context)
 Paints the control.
virtual void show ()
 Shows the frame.
virtual void hide ()
 Hides the frame.
virtual void close ()=0
 Closes the Frame.
virtual bool isFrameTopmost ()
 Is this frame the top most frame amongst the application's current collection of frame windows.
virtual void setFrameTopmost (const bool &isTopmost)
 Makes this frame a topmost floating window.
virtual FrameStyleType getFrameStyle ()
 returns the current frame style.
virtual void setFrameStyle (const FrameStyleType &frameStyle)=0
 Sets the frame style @ see FrameStyleType.
bool allowFrameAsChildControl ()
 By default a frame may have it's parent set to another control without becoming a child control itself.
void setAllowFrameAsChildControl (const bool &val)
bool isActive ()
 Indicates whether or not this frame is active.
virtual void activate ()
 Activates this frame.
virtual bool allowsActivation ()=0
 Indicates to the framework whether or not this frame should allow activation.
virtual void setBorderPath (Path *path)
 modifies the border of the frame to follow the series of points contained in the path.
virtual void setIconImage (Image *icon)=0
 Sets the icon image.
virtual ImagegetIconImage ()=0
 Returns the current image for the frames icon.
virtual bool isActiveFrame ()=0
void setIsActive (const bool &active)
 don't call - for internal use only
virtual void afterCreate (ComponentEvent *event)
 Special initializations may then happen here.
virtual bool allowClose ()
 This method is called by the framework to determine whetehr or not the frame should actually be closed.
void setUseColorForBackground (const bool &val)
 sets if we want to use the control's color to draw the control's background; otherwise the theme background is drawn.
bool getUseColorForBackground ()
 gets if we use the control's color to draw the control's background
void center (uint32 direction=fcdBoth)
 The generic center function.
void centerOnShell (uint32 direction=fcdBoth)
 Center the frame on the shell/desktop.

Static Public Member Functions

static FramegetActiveFrame ()
 A static method uses to determine the current active frame.
static void internal_setActiveFrame (Frame *activeFrame)
 don't call - for internal use only
static DialogcreateDialog (Class *dialogClazz, ResourceBundle *resBundle=NULL)
static WindowcreateWindow (Class *windowClazz, ResourceBundle *resBundle=NULL)

Public Attributes

VCF::Delegate FrameDelegate
VCF::Delegate FrameClose
VCF::Delegate WindowDelegate
VCF::Delegate FrameActivation
VCF::Delegate FrameClosing

Protected Member Functions

virtual void destroy ()
 called by the free() method.

Protected Attributes

String caption_
FrameStyleType frameStyle_
bool isTopmostFrame_
bool useColorForBackground_
bool allowFrameAsChildControl_

Static Protected Attributes

static FramecurrentActiveFrame

Classes

class  State

Detailed Description

A frame is a component that houses other components, plus has special adornments used for interacting with it.

These can include minimize, maximize, restore, system, and help buttons on the caption bar, which is also part of the frame.

Event Delegates for this class:


Member Enumeration Documentation

enum VCF::Frame::FrameEventTypes
 

Enumerator:
ACTIVATION_EVENT 
CLOSE_EVENT 
CLOSING_EVENT 


Constructor & Destructor Documentation

VCF::Frame::Frame  ) 
 

virtual VCF::Frame::~Frame  )  [virtual]
 


Member Function Documentation

virtual void VCF::Frame::activate  )  [virtual]
 

Activates this frame.

This base implementation activates the window only if is not already the active one.

virtual void VCF::Frame::afterCreate ComponentEvent event  )  [virtual]
 

Special initializations may then happen here.

See also:
Component::afterCreate()

Reimplemented from VCF::Control.

virtual bool VCF::Frame::allowClose  )  [virtual]
 

This method is called by the framework to determine whetehr or not the frame should actually be closed.

This method is the first step in determining if a frame can be closed. If it returns true, then the FrameClosing is called. Note that the frame can still be prevented from closing depending on how the event handlers attached to the FrameClosing delegate are implemented. If this method returns false then the frame is not closed, and the FrameClosing event is not fired.

bool VCF::Frame::allowFrameAsChildControl  )  [inline]
 

By default a frame may have it's parent set to another control without becoming a child control itself.

Returns:
bool returns true if the frame is to be allowed to act as a child control when it's setParent() method is called.

virtual bool VCF::Frame::allowsActivation  )  [pure 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.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

void VCF::Frame::center uint32  direction = fcdBoth  ) 
 

The generic center function.

Centers the frame on owner by default or on screen when there is no owner.

void VCF::Frame::centerOnShell uint32  direction = fcdBoth  )  [inline]
 

Center the frame on the shell/desktop.

virtual void VCF::Frame::close  )  [pure virtual]
 

Closes the Frame.

Must be implemented by classes that derive from Frame.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

static Dialog* VCF::Frame::createDialog Class dialogClazz,
ResourceBundle resBundle = NULL
[static]
 

static Window* VCF::Frame::createWindow Class windowClazz,
ResourceBundle resBundle = NULL
[static]
 

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

called by the free() method.

Should be overriden and any clean up code performed here

Reimplemented from VCF::Control.

Reimplemented in VCF::Window.

static Frame* VCF::Frame::getActiveFrame  )  [static]
 

A static method uses to determine the current active frame.

Returns:
Frame the currently active frame. This may be NULL.

virtual String VCF::Frame::getCaption  )  [virtual]
 

The current text of the Frame's caption.

virtual FrameStyleType VCF::Frame::getFrameStyle  )  [inline, virtual]
 

returns the current frame style.

This determines whether the frame is allowed to be resizeable through user interaction, or wether it's got a fixed size. This can also determine the border style of the frame.

See also:
FrameStyleType

virtual Image* VCF::Frame::getIconImage  )  [pure virtual]
 

Returns the current image for the frames icon.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

bool VCF::Frame::getUseColorForBackground  )  [inline]
 

gets if we use the control's color to draw the control's background

Returns:
bool, true if we use the control's color, false if it uses the theme background.

virtual void VCF::Frame::hide  )  [virtual]
 

Hides the frame.

Dependending on the underlying windowing system, the frame may be minimized.

static void VCF::Frame::internal_setActiveFrame Frame activeFrame  )  [static]
 

don't call - for internal use only

bool VCF::Frame::isActive  ) 
 

Indicates whether or not this frame is active.

Returns:
bool returns true if the frame is active otherwise it returns false.

Reimplemented from VCF::Control.

virtual bool VCF::Frame::isActiveFrame  )  [pure virtual]
 

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

virtual bool VCF::Frame::isFrameTopmost  )  [virtual]
 

Is this frame the top most frame amongst the application's current collection of frame windows.

Returns:
bool returns true if the frame is topmost, otherwise it returns false.

virtual void VCF::Frame::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

Implements VCF::Control.

Reimplemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

void VCF::Frame::setAllowFrameAsChildControl const bool &  val  )  [inline]
 

virtual void VCF::Frame::setBorderPath Path path  )  [inline, virtual]
 

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

Reimplemented in VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

virtual void VCF::Frame::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 in VCF::Dialog, and VCF::Window.

virtual void VCF::Frame::setClientBounds Rect bounds  )  [pure virtual]
 

Sets the client bounds only.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

virtual void VCF::Frame::setFrameStyle const FrameStyleType frameStyle  )  [pure virtual]
 

Sets the frame style @ see FrameStyleType.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

virtual void VCF::Frame::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 in VCF::Window.

virtual void VCF::Frame::setIconImage Image icon  )  [pure 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.

Implemented in VCF::Dialog, VCF::PopupWindow, VCF::TransparentWindow, and VCF::Window.

void VCF::Frame::setIsActive const bool &  active  ) 
 

don't call - for internal use only

void VCF::Frame::setUseColorForBackground const bool &  val  )  [inline]
 

sets if we want to use the control's color to draw the control's background; otherwise the theme background is drawn.

Parameters:
const bool&, true if we use the control's color, false if we draw the theme background.

virtual void VCF::Frame::show  )  [virtual]
 

Shows the frame.

Generally the same as calling Control::setVisible(true) It also activates it.

See also:
Control::setVisible

Reimplemented in VCF::Dialog, VCF::MessageDialog, and VCF::PopupWindow.


Member Data Documentation

bool VCF::Frame::allowFrameAsChildControl_ [protected]
 

String VCF::Frame::caption_ [protected]
 

Frame* VCF::Frame::currentActiveFrame [static, protected]
 

VCF::Delegate VCF::Frame::FrameActivation
 

VCF::Delegate VCF::Frame::FrameClose
 

VCF::Delegate VCF::Frame::FrameClosing
 

VCF::Delegate VCF::Frame::FrameDelegate
 

Event Delegate:
FrameClose this is fired when the frame is closed, either in response to events from the underlying windowing system, or programmatically by calling the close() method.
event class: WindowEvent
event type: Frame::CLOSE_EVENT
See also:
close()

FrameStyleType VCF::Frame::frameStyle_ [protected]
 

bool VCF::Frame::isTopmostFrame_ [protected]
 

bool VCF::Frame::useColorForBackground_ [protected]
 

VCF::Delegate VCF::Frame::WindowDelegate
 

Event Delegate:
FrameActivation this is called when the frame becomes activated. Typically this is a result of events that the framework processes from the underlying windowing system. It is also fired when the activate() method is called.
event class: WindowEvent
event type: Frame::ACTIVATION_EVENT
See also:
activate()

Reimplemented in VCF::Window, VCF::Window, and VCF::Window.


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