Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXApp Class Reference

Application Object. More...

#include <FXApp.h>

Inheritance diagram for FX::FXApp:

FX::FXObject List of all members.

Public Types

enum  {
  ID_QUIT = 0,
  ID_DUMP,
  ID_LAST
}

Public Member Functions

 FXApp (const FXString &name="Application", const FXString &vendor="FoxDefault")
FXString getAppName () const
FXString getVendorName () const
FXbool openDisplay (const FXchar *dpyname=NULL)
FXbool closeDisplay ()
void * getDisplay () const
FXbool isInitialized () const
FXint getArgc () const
const FXchar *const * getArgv () const
FXVisualgetDefaultVisual () const
void setDefaultVisual (FXVisual *vis)
FXVisualgetMonoVisual () const
FXRootWindowgetRootWindow () const
FXWindowgetCursorWindow () const
FXWindowgetFocusWindow () const
FXPopupgetPopupWindow () const
FXWindowfindWindowWithId (FXID xid) const
FXWindowfindWindowAt (FXint rx, FXint ry, FXID window=0) const
FXTimer * addTimeout (FXObject *tgt, FXSelector sel, FXuint ms=1000, void *ptr=NULL)
FXTimer * removeTimeout (FXObject *tgt, FXSelector sel)
FXTimer * removeTimeout (FXTimer *t)
FXbool hasTimeout (FXObject *tgt, FXSelector sel) const
FXuint remainingTimeout (FXObject *tgt, FXSelector sel) const
FXuint remainingTimeout (FXTimer *t) const
FXChore * addChore (FXObject *tgt, FXSelector sel, void *ptr=NULL)
FXChore * removeChore (FXObject *tgt, FXSelector sel)
FXChore * removeChore (FXChore *c)
FXbool hasChore (FXObject *tgt, FXSelector sel) const
void addSignal (FXint sig, FXObject *tgt, FXSelector sel, FXbool immediate=FALSE, FXuint flags=0)
void removeSignal (FXint sig)
FXbool addInput (FXInputHandle fd, FXuint mode, FXObject *tgt, FXSelector sel)
FXbool removeInput (FXInputHandle fd, FXuint mode)
virtual void create ()
virtual void destroy ()
virtual void detach ()
FXbool peekEvent ()
FXbool runOneEvent (FXbool blocking=TRUE)
FXint run ()
FXint runUntil (FXuint &condition)
FXint runWhileEvents ()
FXint runModalWhileEvents (FXWindow *window=NULL)
FXint runModal ()
FXint runModalFor (FXWindow *window)
FXint runModalWhileShown (FXWindow *window)
FXint runPopup (FXWindow *window)
FXbool isModal (FXWindow *window) const
FXWindowgetModalWindow () const
FXModality getModality () const
void stop (FXint value=0)
void stopModal (FXWindow *window, FXint value=0)
void stopModal (FXint value=0)
void forceRefresh ()
void refresh ()
void flush (FXbool sync=FALSE)
void repaint ()
virtual void init (int &argc, char **argv, FXbool connect=TRUE)
virtual void exit (FXint code=0)
FXRegistryreg ()
FXDragType registerDragType (const FXString &name) const
FXString getDragTypeName (FXDragType type) const
FXWindowgetDragWindow () const
void beep ()
void setNormalFont (FXFont *font)
FXFontgetNormalFont () const
void beginWaitCursor ()
void endWaitCursor ()
void setWaitCursor (FXCursor *cur)
FXCursorgetWaitCursor () const
FXCursorgetDefaultCursor (FXDefaultCursor which) const
void setDefaultCursor (FXDefaultCursor which, FXCursor *cur)
FXuint getTypingSpeed () const
FXuint getClickSpeed () const
FXuint getScrollSpeed () const
FXuint getScrollDelay () const
FXuint getBlinkSpeed () const
FXuint getAnimSpeed () const
FXuint getMenuPause () const
FXuint getTooltipPause () const
FXuint getTooltipTime () const
FXint getDragDelta () const
FXint getWheelLines () const
void setTypingSpeed (FXuint speed)
void setClickSpeed (FXuint speed)
void setScrollSpeed (FXuint speed)
void setScrollDelay (FXuint delay)
void setBlinkSpeed (FXuint speed)
void setAnimSpeed (FXuint speed)
void setMenuPause (FXuint pause)
void setTooltipPause (FXuint pause)
void setTooltipTime (FXuint time)
void setDragDelta (FXint delta)
void setWheelLines (FXint lines)
FXColor getBorderColor () const
FXColor getBaseColor () const
FXColor getHiliteColor () const
FXColor getShadowColor () const
FXColor getBackColor () const
FXColor getForeColor () const
FXColor getSelforeColor () const
FXColor getSelbackColor () const
FXColor getTipforeColor () const
FXColor getTipbackColor () const
void setBorderColor (FXColor color)
void setBaseColor (FXColor color)
void setHiliteColor (FXColor color)
void setShadowColor (FXColor color)
void setBackColor (FXColor color)
void setForeColor (FXColor color)
void setSelforeColor (FXColor color)
void setSelbackColor (FXColor color)
void setTipforeColor (FXColor color)
void setTipbackColor (FXColor color)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
void dumpWidgets () const
virtual ~FXApp ()

Static Public Member Functions

FXAppinstance ()

Static Public Attributes

const FXuchar copyright []

Detailed Description

Application Object.

See also:


Member Enumeration Documentation

anonymous enum
 

Messages applications understand.

Enumeration values:
ID_QUIT  Terminate the application normally.
ID_DUMP  Dump the current widget tree.


Constructor & Destructor Documentation

FX::FXApp::FXApp const FXString name = "Application",
const FXString vendor = "FoxDefault"
 

Construct application object; the name and vendor strings are used as keys into the registry database for this application's settings.

virtual FX::FXApp::~FXApp  )  [virtual]
 

Destroy the application and all reachable resources.


Member Function Documentation

FXString FX::FXApp::getAppName  )  const [inline]
 

Get application name.

FXString FX::FXApp::getVendorName  )  const [inline]
 

Get vendor name.

FXbool FX::FXApp::openDisplay const FXchar *  dpyname = NULL  ) 
 

Connection to display; this is called by init().

FXbool FX::FXApp::closeDisplay  ) 
 

Close connection to the display.

void* FX::FXApp::getDisplay  )  const [inline]
 

Return pointer.

FXbool FX::FXApp::isInitialized  )  const [inline]
 

Is application initialized.

FXint FX::FXApp::getArgc  )  const [inline]
 

Get argument count.

const FXchar* const* FX::FXApp::getArgv  )  const [inline]
 

Get argument vector.

FXVisual* FX::FXApp::getDefaultVisual  )  const [inline]
 

Get default visual.

void FX::FXApp::setDefaultVisual FXVisual vis  ) 
 

Change default visual.

FXVisual* FX::FXApp::getMonoVisual  )  const [inline]
 

Get monochrome visual.

FXRootWindow* FX::FXApp::getRootWindow  )  const [inline]
 

Get root Window.

FXWindow* FX::FXApp::getCursorWindow  )  const [inline]
 

Get the window under the cursor, if any.

FXWindow* FX::FXApp::getFocusWindow  )  const [inline]
 

Get the window which has the focus, if any.

FXPopup* FX::FXApp::getPopupWindow  )  const [inline]
 

Get current popup window, if any.

FXWindow* FX::FXApp::findWindowWithId FXID  xid  )  const
 

Find window from id.

FXWindow* FX::FXApp::findWindowAt FXint  rx,
FXint  ry,
FXID  window = 0
const
 

Find window from root x,y, starting from given window.

FXTimer* FX::FXApp::addTimeout FXObject tgt,
FXSelector  sel,
FXuint  ms = 1000,
void *  ptr = NULL
 

Add timeout message to be sent to target object in ms milliseconds; the timer fires only once after the interval expires.

The void* ptr is user data which will be passed into the void* ptr of the message handler. If a timer with the same target and message already exists, it will be rescheduled.

FXTimer* FX::FXApp::removeTimeout FXObject tgt,
FXSelector  sel
 

Remove timeout identified by tgt and sel; returns NULL.

FXTimer* FX::FXApp::removeTimeout FXTimer *  t  ) 
 

Remove timeout t; returns NULL.

FXbool FX::FXApp::hasTimeout FXObject tgt,
FXSelector  sel
const
 

Return TRUE if given timeout has been set.

FXuint FX::FXApp::remainingTimeout FXObject tgt,
FXSelector  sel
const
 

Return, in ms, the time remaining until the given timer fires.

If the timer is past due, 0 is returned. If there is no such timer, infinity (UINT_MAX) is returned.

FXuint FX::FXApp::remainingTimeout FXTimer *  t  )  const
 

Return, in ms, the time remaining until the given timer fires.

If the timer is past due, 0 is returned. If there is no such timer, infinity (UINT_MAX) is returned.

FXChore* FX::FXApp::addChore FXObject tgt,
FXSelector  sel,
void *  ptr = NULL
 

Add a idle processing message to be sent to target object when the system becomes idle, i.e.

there are no events to be processed. The void* ptr is user data which will be passed into the void* ptr of the message handler. If a chore with the same target and message already exists, it will be rescheduled.

FXChore* FX::FXApp::removeChore FXObject tgt,
FXSelector  sel
 

Remove idle processing message identified by tgt and sel; returns NULL.

FXChore* FX::FXApp::removeChore FXChore *  c  ) 
 

Remove idle processing message; returns NULL.

FXbool FX::FXApp::hasChore FXObject tgt,
FXSelector  sel
const
 

Return TRUE if given chore has been set.

void FX::FXApp::addSignal FXint  sig,
FXObject tgt,
FXSelector  sel,
FXbool  immediate = FALSE,
FXuint  flags = 0
 

Add signal processing message to be sent to target object when the signal sig is raised; flags are to be set as per POSIX definitions.

When immediate is TRUE, the message will be sent to the target right away; this should be used with extreme care as the application is interrupted at an unknown point in its execution.

void FX::FXApp::removeSignal FXint  sig  ) 
 

Remove signal message for signal sig.

FXbool FX::FXApp::addInput FXInputHandle  fd,
FXuint  mode,
FXObject tgt,
FXSelector  sel
 

Add a file descriptor fd to be watched for activity as determined by mode, where mode is a bitwise OR (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).

A message of type SEL_IO_READ, SEL_IO_WRITE, or SEL_IO_EXCEPT will be sent to the target when the specified activity is detected on the file descriptor.

FXbool FX::FXApp::removeInput FXInputHandle  fd,
FXuint  mode
 

Remove input message and target object for the specified file descriptor and mode, which is a bitwise OR of (INPUT_READ, INPUT_WRITE, INPUT_EXCEPT).

virtual void FX::FXApp::create  )  [virtual]
 

Create application's windows.

virtual void FX::FXApp::destroy  )  [virtual]
 

Destroy application's windows.

virtual void FX::FXApp::detach  )  [virtual]
 

Detach application's windows.

FXbool FX::FXApp::peekEvent  ) 
 

Peek to determine if there's an event.

FXbool FX::FXApp::runOneEvent FXbool  blocking = TRUE  ) 
 

Perform one event dispatch; return true if event was dispatched.

FXint FX::FXApp::run  ) 
 

Run the main application event loop until stop() is called, and return the exit code passed as argument to stop().

FXint FX::FXApp::runUntil FXuint &  condition  ) 
 

Run an event loop till some flag becomes non-zero, and then return.

FXint FX::FXApp::runWhileEvents  ) 
 

Run event loop while events are available, non-modally.

Return when no more events, timers, or chores are outstanding.

FXint FX::FXApp::runModalWhileEvents FXWindow window = NULL  ) 
 

Run event loop while there are events are available in the queue.

Returns 1 when all events in the queue have been handled, and 0 when the event loop was terminated due to stop() or stopModal(). Except for the modal window and its children, user input to all windows is blocked; if the modal window is NULL, all user input is blocked.

FXint FX::FXApp::runModal  ) 
 

Run modal event loop, blocking keyboard and mouse events to all windows until stopModal is called.

FXint FX::FXApp::runModalFor FXWindow window  ) 
 

Run a modal event loop for the given window, until stop() or stopModal() is called.

Except for the modal window and its children, user input to all windows is blocked; if the modal window is NULL all user input is blocked.

FXint FX::FXApp::runModalWhileShown FXWindow window  ) 
 

Run modal while window is shown, or until stop() or stopModal() is called.

Except for the modal window and its children, user input to all windows is blocked; if the modal window is NULL all user input is blocked.

FXint FX::FXApp::runPopup FXWindow window  ) 
 

Run popup menu while shown, until stop() or stopModal() is called.

Also returns when entering previous cascading popup menu.

FXbool FX::FXApp::isModal FXWindow window  )  const
 

True if the window is modal.

FXWindow* FX::FXApp::getModalWindow  )  const
 

Return window of current modal loop.

FXModality FX::FXApp::getModality  )  const
 

Return mode of current modal loop.

void FX::FXApp::stop FXint  value = 0  ) 
 

Terminate the outermost event loop, and all inner modal loops; All more deeper nested event loops will be terminated with code equal to 0, while the outermost event loop will return code equal to value.

void FX::FXApp::stopModal FXWindow window,
FXint  value = 0
 

Break out of the matching modal loop, returning code equal to value.

All deeper nested event loops are terminated with code equal to 0.

void FX::FXApp::stopModal FXint  value = 0  ) 
 

Break out of the innermost modal loop, returning code equal to value.

void FX::FXApp::forceRefresh  ) 
 

Force GUI refresh.

void FX::FXApp::refresh  ) 
 

Schedule a refresh.

void FX::FXApp::flush FXbool  sync = FALSE  ) 
 

Flush pending repaints.

void FX::FXApp::repaint  ) 
 

Paint all windows marked for repainting.

On return all the applications windows have been painted.

virtual void FX::FXApp::init int &  argc,
char **  argv,
FXbool  connect = TRUE
[virtual]
 

Initialize application.

Parses and removes common command line arguments, reads the registry. Finally, if connect is TRUE, it opens the display.

virtual void FX::FXApp::exit FXint  code = 0  )  [virtual]
 

Exit application.

Closes the display and writes the registry.

FXRegistry& FX::FXApp::reg  )  [inline]
 

Get registry.

FXDragType FX::FXApp::registerDragType const FXString name  )  const
 

Register new DND type.

FXString FX::FXApp::getDragTypeName FXDragType  type  )  const
 

Get drag type name.

FXWindow* FX::FXApp::getDragWindow  )  const [inline]
 

Return drag window if a drag operation is in progress.

void FX::FXApp::beep  ) 
 

Beep.

FXApp* FX::FXApp::instance  )  [inline, static]
 

Return application instance.

void FX::FXApp::setNormalFont FXFont font  ) 
 

Change default font.

FXFont* FX::FXApp::getNormalFont  )  const [inline]
 

Return default font.

void FX::FXApp::beginWaitCursor  ) 
 

Begin of wait-cursor block; wait-cursor blocks may be nested.

void FX::FXApp::endWaitCursor  ) 
 

End of wait-cursor block.

void FX::FXApp::setWaitCursor FXCursor cur  ) 
 

Change to a new wait cursor.

FXCursor* FX::FXApp::getWaitCursor  )  const [inline]
 

Return current wait cursor.

FXCursor* FX::FXApp::getDefaultCursor FXDefaultCursor  which  )  const [inline]
 

Obtain a default cursor.

void FX::FXApp::setDefaultCursor FXDefaultCursor  which,
FXCursor cur
 

Change default cursor.

FXuint FX::FXApp::getTypingSpeed  )  const [inline]
 

Obtain application-wide settings.

void FX::FXApp::setTypingSpeed FXuint  speed  ) 
 

Change application-wide settings.

FXColor FX::FXApp::getBorderColor  )  const [inline]
 

Obtain default colors.

void FX::FXApp::setBorderColor FXColor  color  ) 
 

Change default colors.

virtual void FX::FXApp::save FXStream store  )  const [virtual]
 

Save.

Reimplemented from FX::FXObject.

virtual void FX::FXApp::load FXStream store  )  [virtual]
 

Load.

Reimplemented from FX::FXObject.

void FX::FXApp::dumpWidgets  )  const
 

Dump widget information.


Member Data Documentation

const FXuchar FX::FXApp::copyright[] [static]
 

Information.

Copyright © 1997-2004 Jeroen van der Zijp