FXTopWindow.h

Go to the documentation of this file.
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,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXTopWindow.h,v 1.62 2006/01/22 17:58:11 fox Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXTOPWINDOW_H
00025 #define FXTOPWINDOW_H
00026 
00027 #ifndef FXSHELL_H
00028 #include "FXShell.h"
00029 #endif
00030 
00031 
00032 namespace FX {
00033 
00034 
00036 enum {
00037   DECOR_NONE        = 0,                                  
00038   DECOR_TITLE       = 0x00020000,                         
00039   DECOR_MINIMIZE    = 0x00040000,                         
00040   DECOR_MAXIMIZE    = 0x00080000,                         
00041   DECOR_CLOSE       = 0x00100000,                         
00042   DECOR_BORDER      = 0x00200000,                         
00043   DECOR_SHRINKABLE  = 0x00400000,                         
00044   DECOR_STRETCHABLE = 0x00800000,                         
00045   DECOR_RESIZE      = DECOR_SHRINKABLE|DECOR_STRETCHABLE, 
00046   DECOR_MENU        = 0x01000000,                         
00047   // FXHandedInterface uses 0x02000000 onwards
00048   DECOR_ALLBUTRESIZE= (DECOR_TITLE|DECOR_CLOSE|DECOR_BORDER|DECOR_MENU),
00049   DECOR_ALL         = (DECOR_TITLE|DECOR_MINIMIZE|DECOR_MAXIMIZE|DECOR_CLOSE|DECOR_BORDER|DECOR_SHRINKABLE|DECOR_STRETCHABLE|DECOR_MENU)
00050   };
00051 
00052 
00054 enum {
00055   PLACEMENT_DEFAULT,                  
00056   PLACEMENT_VISIBLE,                  
00057   PLACEMENT_CURSOR,                   
00058   PLACEMENT_OWNER,                    
00059   PLACEMENT_SCREEN,                   
00060   PLACEMENT_MAXIMIZED                 
00061   };
00062 
00063 
00064 class FXToolBar;
00065 class FXIcon;
00066 
00067 
00068 
00096 class FXAPI FXTopWindow : public FXShell {
00097   FXDECLARE_ABSTRACT(FXTopWindow)
00098 protected:
00099   FXString  title;                    // Window title
00100   FXIcon   *icon;                     // Window icon (big)
00101   FXIcon   *miniIcon;                 // Window icon (small)
00102   FXint     padtop;                   // Top margin
00103   FXint     padbottom;                // Bottom margin
00104   FXint     padleft;                  // Left margin
00105   FXint     padright;                 // Right margin
00106   FXint     hspacing;                 // Horizontal child spacing
00107   FXint     vspacing;                 // Vertical child spacing
00108 protected:
00109   FXTopWindow();
00110   void settitle();
00111   void seticons();
00112   void setdecorations();
00113   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);
00114   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);
00115 private:
00116   FXTopWindow(const FXTopWindow&);
00117   FXTopWindow& operator=(const FXTopWindow&);
00118 #ifdef WIN32
00119   virtual const char* GetClass() const;
00120 #endif
00121 public:
00122   long onFocusUp(FXObject*,FXSelector,void*);
00123   long onFocusDown(FXObject*,FXSelector,void*);
00124   long onFocusLeft(FXObject*,FXSelector,void*);
00125   long onFocusRight(FXObject*,FXSelector,void*);
00126   long onSessionNotify(FXObject*,FXSelector,void*);
00127   long onSessionClosed(FXObject*,FXSelector,void*);
00128   long onCmdMaximize(FXObject*,FXSelector,void*);
00129   long onCmdMinimize(FXObject*,FXSelector,void*);
00130   long onCmdRestore(FXObject*,FXSelector,void*);
00131   long onCmdClose(FXObject*,FXSelector,void*);
00132   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00133   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00134   long onCmdSetIconValue(FXObject*,FXSelector,void*);
00135   long onCmdGetIconValue(FXObject*,FXSelector,void*);
00136 public:
00137   enum {
00138     ID_MAXIMIZE=FXShell::ID_LAST,       
00139     ID_MINIMIZE,                        
00140     ID_RESTORE,                         
00141     ID_CLOSE,                           
00142     ID_QUERY_DOCK,                      
00143     ID_LAST
00144     };
00145 public:
00146 
00148   virtual void create();
00149 
00151   virtual void detach();
00152 
00154   virtual void destroy();
00155 
00157   virtual void layout();
00158 
00160   virtual void setFocus();
00161 
00163   virtual void killFocus();
00164 
00166   virtual void show();
00167 
00169   virtual void hide();
00170 
00172   virtual void show(FXuint placement);
00173 
00175   void place(FXuint placement);
00176 
00178   virtual FXint getDefaultWidth();
00179 
00181   virtual FXint getDefaultHeight();
00182 
00184   FXbool getWMBorders(FXint& left,FXint& right,FXint& top,FXint& bottom);
00185 
00187   virtual void raise();
00188 
00190   virtual void move(FXint x,FXint y);
00191 
00193   virtual void resize(FXint w,FXint h);
00194 
00196   virtual void position(FXint x,FXint y,FXint w,FXint h);
00197 
00199   virtual FXbool maximize(FXbool notify=FALSE);
00200 
00202   virtual FXbool minimize(FXbool notify=FALSE);
00203 
00205   virtual FXbool restore(FXbool notify=FALSE);
00206 
00214   virtual FXbool close(FXbool notify=FALSE);
00215 
00217   FXbool isMaximized() const;
00218 
00220   FXbool isMinimized() const;
00221 
00223   void setTitle(const FXString& name);
00224 
00226   FXString getTitle() const { return title; }
00227 
00229   void setPadTop(FXint pt);
00230 
00232   FXint getPadTop() const { return padtop; }
00233 
00235   void setPadBottom(FXint pb);
00236 
00238   FXint getPadBottom() const { return padbottom; }
00239 
00241   void setPadLeft(FXint pl);
00242 
00244   FXint getPadLeft() const { return padleft; }
00245 
00247   void setPadRight(FXint pr);
00248 
00250   FXint getPadRight() const { return padright; }
00251 
00253   FXint getHSpacing() const { return hspacing; }
00254 
00256   FXint getVSpacing() const { return vspacing; }
00257 
00259   void setHSpacing(FXint hs);
00260 
00262   void setVSpacing(FXint vs);
00263 
00265   void setPackingHints(FXuint ph);
00266 
00268   FXuint getPackingHints() const;
00269 
00271   void setDecorations(FXuint decorations);
00272 
00274   FXuint getDecorations() const;
00275 
00277   FXIcon* getIcon() const { return icon; }
00278 
00280   void setIcon(FXIcon* ic);
00281 
00283   FXIcon* getMiniIcon() const { return miniIcon; }
00284 
00286   void setMiniIcon(FXIcon *ic);
00287 
00289   virtual void save(FXStream& store) const;
00290 
00292   virtual void load(FXStream& store);
00293 
00295   virtual ~FXTopWindow();
00296   };
00297 
00298 }
00299 
00300 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:25 2009 for TnFOX by doxygen v1.4.7