1 /********************************************************************************
2 *                                                                               *
3 *                          P i c k e r   B u t t o n                            *
4 *                                                                               *
5 *********************************************************************************
6 * Copyright (C) 2001,2020 by Jeroen van der Zijp.   All Rights Reserved.        *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify          *
9 * it under the terms of the GNU Lesser General Public License as published by   *
10 * the Free Software Foundation; either version 3 of the License, or             *
11 * (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                 *
16 * GNU Lesser General Public License for more details.                           *
17 *                                                                               *
18 * You should have received a copy of the GNU Lesser General Public License      *
19 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
20 ********************************************************************************/
21 #ifndef FXPICKER_H
22 #define FXPICKER_H
23 
24 #ifndef FXBUTTON_H
25 #include "FXButton.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 /**
32 * A Picker button allows you to identify an arbitrary location on the screen.
33 * It generates SEL_CHANGED callbacks while the user is moving the mouse, and
34 * a final SEL_COMMAND when a location has been identified.  The void* parameter
35 * in the callback is a pointer to FXPoint, the location, in root-coordinates, of
36 * the place where the click took place.
37 */
38 class FXAPI FXPicker : public FXButton {
39   FXDECLARE(FXPicker)
40 protected:
41   FXPoint location;     // Location
42   FXbool  picked;       // Clicked
43 protected:
44   FXPicker();
45 private:
46   FXPicker(const FXPicker&);
47   FXPicker& operator=(const FXPicker&);
48 public:
49   long onMotion(FXObject*,FXSelector,void*);
50   long onLeftBtnPress(FXObject*,FXSelector,void*);
51   long onLeftBtnRelease(FXObject*,FXSelector,void*);
52   long onKeyPress(FXObject*,FXSelector,void*);
53   long onKeyRelease(FXObject*,FXSelector,void*);
54   long onHotKeyPress(FXObject*,FXSelector,void*);
55   long onHotKeyRelease(FXObject*,FXSelector,void*);
56 public:
57 
58   /// Construct picker button with text and icon
59   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);
60   };
61 
62 }
63 
64 #endif
65