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

FX::FXApp Class Reference

#include <FXApp.h>

Inheritance diagram for FX::FXApp:

FX::FXObject List of all members.

Public Types

enum  {
  ID_QUIT = 0,
  ID_DUMP,
  ID_LAST
}
 Messages applications understand. More...


Public Methods

 FXApp (const FXString &name="Application", const FXString &vendor="FoxDefault")
 Copyright notice of library.

const FXStringgetAppName () const
 Get application name.

const FXStringgetVendorName () const
 Get vendor name.

FXbool openDisplay (const FXchar *dpyname=NULL)
 Connection to display; this is called by init().

FXbool closeDisplay ()
 Close connection to the display.

void * getDisplay () const
 Return pointer.

FXint getArgc () const
 Get argument count.

const FXchar *const * getArgv () const
 Get argument vector.

FXVisualgetDefaultVisual () const
 Get default visual.

void setDefaultVisual (FXVisual *vis)
 Change default visual.

FXVisualgetMonoVisual () const
 Get monochrome visual.

FXRootWindowgetRootWindow () const
 Get root Window.

FXWindowgetCursorWindow () const
 Get the window under the cursor, if any.

FXWindowgetFocusWindow () const
 Get the window which has the focus, if any.

FXPopupgetPopupWindow () const
 Get current popup window, if any.

FXWindowfindWindowWithId (FXID xid) const
 Find window from id.

FXWindowfindWindowAt (FXint rx, FXint ry, FXID window=0) const
 Find window from root x,y, starting from given window.

FXTimer * addTimeout (FXint ms, FXObject *tgt, FXSelector sel)
FXTimer * removeTimeout (FXTimer *t)
 Remove timeout, returns NULL.

FXChore * addChore (FXObject *tgt, FXSelector sel)
FXChore * removeChore (FXChore *c)
 Remove idle processing message.

void addSignal (FXint sig, FXObject *tgt, FXSelector sel, FXbool immediate=FALSE, FXuint flags=0)
void removeSignal (FXint sig)
 Remove signal message for signal sig.

FXbool addInput (FXInputHandle fd, FXuint mode, FXObject *tgt, FXSelector sel)
FXbool removeInput (FXInputHandle fd, FXuint mode)
virtual void create ()
 Create application's windows.

virtual void destroy ()
 Destroy application's windows.

virtual void detach ()
 Detach application's windows.

FXbool peekEvent ()
 Peek to determine if there's an event.

void runOneEvent ()
 Perform one event dispatch.

FXint run ()
FXint runUntil (FXuint &condition)
 Run an event loop till some flag becomes non-zero.

FXint runWhileEvents (FXWindow *window=NULL)
FXint runModal ()
FXint runModalFor (FXWindow *window)
FXint runModalWhileShown (FXWindow *window)
FXint runPopup (FXWindow *window)
FXbool isModal (FXWindow *window) const
 True if the window is modal.

FXWindowgetModalWindow () const
 Return window of current modal loop.

FXModality getModality () const
 Return mode of current modal loop.

void stop (FXint value=0)
void stopModal (FXWindow *window, FXint value=0)
void stopModal (FXint value=0)
void forceRefresh ()
 Force GUI refresh.

void refresh ()
 Schedule a refresh.

void flush (FXbool sync=FALSE)
 Flush pending repaints.

void repaint ()
virtual void init (int &argc, char **argv, FXbool connect=TRUE)
virtual void exit (FXint code=0)
FXRegistryreg ()
 Get registry.

FXDragType registerDragType (const FXString &name) const
 Register new DND type.

FXString getDragTypeName (FXDragType type) const
 Get drag type name.

void beep ()
 Beep.

void setNormalFont (FXFont *font)
 Change default font.

FXFontgetNormalFont () const
 Return default font.

void beginWaitCursor ()
 Begin of wait-cursor block; wait-cursor blocks may be nested.

void endWaitCursor ()
 End of wait-cursor block.

void setWaitCursor (FXCursor *cur)
 Change to a new wait cursor.

FXCursorgetWaitCursor () const
 Return current wait cursor.

FXCursorgetDefaultCursor (FXDefaultCursor which) const
 Obtain a default cursor.

void setDefaultCursor (FXDefaultCursor which, FXCursor *cur)
 Change default cursor.

FXuint getTypingSpeed () const
 Obtain application-wide settings.

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)
 Change application-wide settings.

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
 Obtain default colors.

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)
 Change default colors.

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
 Save.

virtual void load (FXStream &store)
 Load.

void dumpWidgets () const
 Dump widget information.

virtual ~FXApp ()
 Destroy the application and all reachable resources.


Static Public Methods

FXApp * instance ()
 Return application instance.


Static Public Attributes

const FXuchar copyright [] = "Copyright (C) 1997,2002 Jeroen van der Zijp. All Rights Reserved."
 Information.


Friends

class FXId
class FXBitmap
class FXImage
class FXIcon
class FXCursor
class FXDrawable
class FXWindow
class FXShell
class FXRootWindow
class FXTopWindow
class FXMainWindow
class FXPopup
class FXFont
class FXVisual
class FXGLVisual
class FXGLContext
class FXDC
class FXDCWindow

Detailed Description

Application Object

See also:


Member Enumeration Documentation

anonymous enum
 

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


Member Function Documentation

FXTimer * FX::FXApp::addTimeout FXint    ms,
FXObject   tgt,
FXSelector    sel
 

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

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

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.

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.

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).

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::runWhileEvents 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.

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::repaint  
 

Paint all windows marked for repainting. On return all the applications windows have been painted.

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.

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

Exit application. Closes the display and writes the registry.