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

FXPicker.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                          P i c k e r   B u t t o n                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2001,2009 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 * $Id: FXPicker.h,v 1.16 2009/01/06 13:07:26 fox Exp $                          *
00022 ********************************************************************************/
00023 #ifndef FXPICKER_H
00024 #define FXPICKER_H
00025 
00026 #ifndef FXBUTTON_H
00027 #include "FXButton.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * A Picker button allows you to identify an arbitrary location on the screen.
00035 * It generates SEL_CHANGED callbacks while the user is moving the mouse, and
00036 * a final SEL_COMMAND when a location has been identified.  The void* parameter
00037 * in the callback is a pointer to FXPoint, the location, in root-coordinates, of
00038 * the place where the click took place.
00039 */
00040 class FXAPI FXPicker : public FXButton {
00041   FXDECLARE(FXPicker)
00042 protected:
00043   FXPoint location;     // Location
00044   FXbool  picked;       // Clicked
00045 protected:
00046   FXPicker();
00047 private:
00048   FXPicker(const FXPicker&);
00049   FXPicker& operator=(const FXPicker&);
00050 public:
00051   long onMotion(FXObject*,FXSelector,void*);
00052   long onLeftBtnPress(FXObject*,FXSelector,void*);
00053   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00054   long onKeyPress(FXObject*,FXSelector,void*);
00055   long onKeyRelease(FXObject*,FXSelector,void*);
00056   long onHotKeyPress(FXObject*,FXSelector,void*);
00057   long onHotKeyRelease(FXObject*,FXSelector,void*);
00058 public:
00059 
00060   /// Construct picker button with text and icon
00061   FXPicker(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=BUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00062   };
00063 
00064 }
00065 
00066 #endif

Copyright © 1997-2009 Jeroen van der Zijp