1 /******************************************************************************** 2 * * 3 * C o m p o s i t e W i d g e t * 4 * * 5 ********************************************************************************* 6 * Copyright (C) 1997,2005 by Jeroen van der Zijp. All Rights Reserved. * 7 ********************************************************************************* 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU Lesser General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2.1 of the License, or (at your option) any later version. * 12 * * 13 * This library is distributed in the hope that it will be useful, * 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 16 * Lesser General Public License for more details. * 17 * * 18 * You should have received a copy of the GNU Lesser General Public * 19 * License along with this library; if not, write to the Free Software * 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 21 ********************************************************************************* 22 * $Id: FXComposite.h,v 1.22 2005/01/16 16:06:06 fox Exp $ * 23 ********************************************************************************/ 24 #ifndef FXCOMPOSITE_H 25 #define FXCOMPOSITE_H 26 27 #ifndef FXWINDOW_H 28 #include "FXWindow.h" 29 #endif 30 31 namespace FX { 32 33 34 /// Base composite 35 class FXAPI FXComposite : public FXWindow { FXDECLARE(FXComposite)36 FXDECLARE(FXComposite) 37 protected: 38 FXComposite(){} 39 FXComposite(FXApp* a,FXVisual *vis); 40 FXComposite(FXApp* a,FXWindow* own,FXuint opts,FXint x,FXint y,FXint w,FXint h); 41 private: 42 FXComposite(const FXComposite&); 43 FXComposite &operator=(const FXComposite&); 44 public: 45 long onKeyPress(FXObject*,FXSelector,void*); 46 long onKeyRelease(FXObject*,FXSelector,void*); 47 long onFocusNext(FXObject*,FXSelector,void*); 48 long onFocusPrev(FXObject*,FXSelector,void*); 49 long onCmdUpdate(FXObject*,FXSelector,void*); 50 public: 51 52 /// Constructor 53 FXComposite(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 54 55 /// Create server-side resources 56 virtual void create(); 57 58 /// Detach server-side resources 59 virtual void detach(); 60 61 /// Destroy server-side resources 62 virtual void destroy(); 63 64 /// Perform layout 65 virtual void layout(); 66 67 /// Return default width 68 virtual FXint getDefaultWidth(); 69 70 /// Return default height 71 virtual FXint getDefaultHeight(); 72 73 /// Return the width of the widest child window 74 FXint maxChildWidth() const; 75 76 /// Return the height of the tallest child window 77 FXint maxChildHeight() const; 78 79 /// Overrides this virtual function to return TRUE 80 virtual FXbool isComposite() const; 81 82 /// Destructor 83 virtual ~FXComposite(); 84 }; 85 86 } 87 88 #endif 89