root / argos / src / UI Panels / EditorCore.h @ 63
View | Annotate | Download (2.6 KB)
| 1 | /***********************************************************************
|
|---|---|
| 2 | |
| 3 | Copyright (c) 2009, 2010 Dimitri Diakopoulos, http://argos.dimitridiakopoulos.com/ |
| 4 | |
| 5 | Redistribution and use in source and binary forms, with or without modification, |
| 6 | are permitted provided that the following conditions are met: |
| 7 | |
| 8 | 1. Redistributions of source code must retain the above copyright notice, |
| 9 | this list of conditions and the following disclaimer. |
| 10 | |
| 11 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | this list of conditions and the following disclaimer in the documentation and/or |
| 13 | other materials provided with the distribution. |
| 14 | |
| 15 | 3. The name of the author may not be used to endorse or promote products derived |
| 16 | from this software without specific prior written permission. |
| 17 | |
| 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | ARE DISCLAIMED. IN NOEVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
| 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 | (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 | LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 25 | AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 27 | OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | |
| 29 | *************************************************************************/ |
| 30 | #pragma once
|
| 31 | |
| 32 | #include "ofxArgosUI.h" |
| 33 | #include "EditorActions.h" |
| 34 | |
| 35 | class EditorPanel {
|
| 36 | |
| 37 | public:
|
| 38 | |
| 39 | EditorPanel(); |
| 40 | |
| 41 | // Put this in a more appropriate place
|
| 42 | std::ostringstream ostr; |
| 43 | |
| 44 | ofxArgosUI *gui; |
| 45 | ofxArgosUI_Panel *editor; |
| 46 | |
| 47 | resizeControl *rControl; |
| 48 | |
| 49 | ofxArgosUI_Button *editing; |
| 50 | ofxArgosUI_Button *cancel; |
| 51 | ofxArgosUI_TextField *label; |
| 52 | ofxArgosUI_TextField *x; |
| 53 | ofxArgosUI_TextField *y; |
| 54 | ofxArgosUI_TextField *w; |
| 55 | ofxArgosUI_TextField *h; |
| 56 | ofxArgosUI_TextField *osc; |
| 57 | |
| 58 | bool e_apply;
|
| 59 | bool e_cancel;
|
| 60 | bool e_reset;
|
| 61 | |
| 62 | string e_label; |
| 63 | string e_x; |
| 64 | string e_y; |
| 65 | string e_w; |
| 66 | string e_h; |
| 67 | string e_osc; |
| 68 | |
| 69 | void init(ofxArgosUI &gui);
|
| 70 | void populate();
|
| 71 | void update();
|
| 72 | |
| 73 | void clearProperties();
|
| 74 | void loadProperties();
|
| 75 | void setProperties();
|
| 76 | void updateProperties();
|
| 77 | |
| 78 | void removeControl();
|
| 79 | |
| 80 | void updateX(int direction); |
| 81 | void updateY(int direction); |
| 82 | |
| 83 | void updateSize(int width, int height); |
| 84 | |
| 85 | string toStr(float input);
|
| 86 | |
| 87 | }; |
