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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXTopWindow.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                 T o p - L e v e l   W i n d o w   W i d g e t                 *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXTOPWINDOW_H
00022 #define FXTOPWINDOW_H
00023 
00024 #ifndef FXSHELL_H
00025 #include "FXShell.h"
00026 #endif
00027 
00028 
00029 namespace FX {
00030 
00031 
00033 enum {
00034   DECOR_NONE        = 0,                                  
00035   DECOR_TITLE       = 0x00020000,                         
00036   DECOR_MINIMIZE    = 0x00040000,                         
00037   DECOR_MAXIMIZE    = 0x00080000,                         
00038   DECOR_CLOSE       = 0x00100000,                         
00039   DECOR_BORDER      = 0x00200000,                         
00040   DECOR_SHRINKABLE  = 0x00400000,                         
00041   DECOR_STRETCHABLE = 0x00800000,                         
00042   DECOR_RESIZE      = DECOR_SHRINKABLE|DECOR_STRETCHABLE, 
00043   DECOR_MENU        = 0x01000000,                         
00044   DECOR_ALL         = (DECOR_TITLE|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_BORDER|DECOR_SHRINKABLE|DECOR_STRETCHABLE|DECOR_MENU)
00045   };
00046 
00047 
00049 enum {
00050   PLACEMENT_DEFAULT,            
00051   PLACEMENT_VISIBLE,            
00052   PLACEMENT_CURSOR,             
00053   PLACEMENT_OWNER,              
00054   PLACEMENT_SCREEN,             
00055   PLACEMENT_MAXIMIZED           
00056   };
00057 
00058 
00060 enum {
00061   STACK_NORMAL,                 
00062   STACK_BOTTOM,                 
00063   STACK_TOP                     
00064   };
00065 
00066 
00067 class FXToolBar;
00068 class FXIcon;
00069 
00070 
00098 class FXAPI FXTopWindow : public FXShell {
00099   FXDECLARE_ABSTRACT(FXTopWindow)
00100 protected:
00101   FXString  title;                    // Window title
00102   FXIcon   *icon;                     // Window icon (big)
00103   FXIcon   *miniIcon;                 // Window icon (small)
00104   FXint     padtop;                   // Top margin
00105   FXint     padbottom;                // Bottom margin
00106   FXint     padleft;                  // Left margin
00107   FXint     padright;                 // Right margin
00108   FXint     hspacing;                 // Horizontal child spacing
00109   FXint     vspacing;                 // Vertical child spacing
00110 protected:
00111   FXTopWindow();
00112   void settitle();
00113   void seticons();
00114   void setdecorations();
00115   FXTopWindow(FXApp* ap,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
00116   FXTopWindow(FXWindow* ow,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs);
00117 private:
00118   FXTopWindow(const FXTopWindow&);
00119   FXTopWindow& operator=(const FXTopWindow&);
00120 #ifdef WIN32
00121   virtual const void* GetClass() const;
00122 #endif
00123 public:
00124   long onFocusUp(FXObject*,FXSelector,void*);
00125   long onFocusDown(FXObject*,FXSelector,void*);
00126   long onFocusLeft(FXObject*,FXSelector,void*);
00127   long onFocusRight(FXObject*,FXSelector,void*);
00128   long onSessionNotify(FXObject*,FXSelector,void*);
00129   long onSessionClosed(FXObject*,FXSelector,void*);
00130   long onRestore(FXObject*,FXSelector,void*);
00131   long onMaximize(FXObject*,FXSelector,void*);
00132   long onMinimize(FXObject*,FXSelector,void*);
00133   long onCmdRestore(FXObject*,FXSelector,void*);
00134   long onCmdMaximize(FXObject*,FXSelector,void*);
00135   long onCmdMinimize(FXObject*,FXSelector,void*);
00136   long onCmdFullScreen(FXObject*,FXSelector,void*);
00137   long onCmdClose(FXObject*,FXSelector,void*);
00138   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00139   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00140   long onCmdSetIconValue(FXObject*,FXSelector,void*);
00141   long onCmdGetIconValue(FXObject*,FXSelector,void*);
00142 public:
00143   enum {
00144     ID_RESTORE=FXShell::ID_LAST,        
00145     ID_MAXIMIZE,                        
00146     ID_MINIMIZE,                        
00147     ID_FULLSCREEN,                      
00148     ID_CLOSE,                           
00149     ID_QUERY_DOCK,                      
00150     ID_LAST
00151     };
00152 public:
00153 
00155   virtual void create();
00156 
00158   virtual void detach();
00159 
00161   virtual void destroy();
00162 
00164   virtual void layout();
00165 
00167   virtual void setFocus();
00168 
00170   virtual void killFocus();
00171 
00173   virtual void show();
00174 
00176   virtual void hide();
00177 
00179   virtual void show(FXuint placement);
00180 
00182   void place(FXuint placement);
00183 
00185   virtual FXint getDefaultWidth();
00186 
00188   virtual FXint getDefaultHeight();
00189 
00191   FXbool getWMBorders(FXint& left,FXint& right,FXint& top,FXint& bottom);
00192 
00194   virtual void raise();
00195 
00197   virtual void lower();
00198 
00200   virtual void move(FXint x,FXint y);
00201 
00203   virtual void resize(FXint w,FXint h);
00204 
00206   virtual void position(FXint x,FXint y,FXint w,FXint h);
00207 
00209   virtual void flash(FXbool yes);
00210 
00212   virtual FXbool restore(FXbool notify=false);
00213 
00215   virtual FXbool maximize(FXbool notify=false);
00216 
00218   virtual FXbool minimize(FXbool notify=false);
00219 
00221   virtual FXbool fullScreen(FXbool notify=false);
00222 
00224   virtual FXbool stackingOrder(FXuint order);
00225 
00233   virtual FXbool close(FXbool notify=false);
00234 
00236   FXbool isMaximized() const;
00237 
00239   FXbool isMinimized() const;
00240 
00242   FXbool isFullScreen() const;
00243 
00245   void setTitle(const FXString& name);
00246 
00248   FXString getTitle() const { return title; }
00249 
00251   void setPadTop(FXint pt);
00252 
00254   FXint getPadTop() const { return padtop; }
00255 
00257   void setPadBottom(FXint pb);
00258 
00260   FXint getPadBottom() const { return padbottom; }
00261 
00263   void setPadLeft(FXint pl);
00264 
00266   FXint getPadLeft() const { return padleft; }
00267 
00269   void setPadRight(FXint pr);
00270 
00272   FXint getPadRight() const { return padright; }
00273 
00275   FXint getHSpacing() const { return hspacing; }
00276 
00278   FXint getVSpacing() const { return vspacing; }
00279 
00281   void setHSpacing(FXint hs);
00282 
00284   void setVSpacing(FXint vs);
00285 
00287   void setPackingHints(FXuint ph);
00288 
00290   FXuint getPackingHints() const;
00291 
00293   void setDecorations(FXuint decorations);
00294 
00296   FXuint getDecorations() const;
00297 
00299   FXIcon* getIcon() const { return icon; }
00300 
00302   void setIcon(FXIcon* ic);
00303 
00305   FXIcon* getMiniIcon() const { return miniIcon; }
00306 
00308   void setMiniIcon(FXIcon *ic);
00309 
00311   virtual void save(FXStream& store) const;
00312 
00314   virtual void load(FXStream& store);
00315 
00317   virtual ~FXTopWindow();
00318   };
00319 
00320 }
00321 
00322 #endif

Copyright © 1997-2011 Jeroen van der Zijp