Skip to content

Commit

Permalink
small tweaks to example and addon_config.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
ofTheo committed Oct 18, 2019
1 parent 8bbdacd commit ad32cca
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
19 changes: 19 additions & 0 deletions addon_config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta:
ADDON_NAME = ofxControlPanel
ADDON_DESCRIPTION = A multi-tab control panel addon
ADDON_AUTHOR = Theo Watson, Nick Hardeman
ADDON_TAGS = "gui" "control panel"
ADDON_URL = https://github.com/ofTheo/ofxControlPanel

common:
ADDON_DEPENDENCIES = ofxXmlSettings

osx:

vs:

linux64:

linux:

linuxarmv7l:
5 changes: 1 addition & 4 deletions example/addons.make
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# List the names of all required addons below.
# These are the names of the folders in OF_ROOT/addons

ofxControlPanel
ofxOpenCv
ofxXmlSettings
ofxControlPanel
2 changes: 1 addition & 1 deletion example/src/main.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//========================================================================
int main( ){

ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
ofSetupOpenGL(1280, 900, OF_WINDOW); // <-------- setup the GL context

// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
Expand Down
25 changes: 11 additions & 14 deletions example/src/ofApp.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,41 @@ void ofApp::setup(){

ofSetVerticalSync(true);

gui.setup("test cv", 0, 0, ofGetWidth(), 700);
gui.setup("test cv", 0, 0);
gui.addPanel("control panel test", 4, false);

//--------- PANEL 1
gui.setWhichPanel(0);
gui.setWhichColumn(0);
gui.addFpsChartPlotter();
gui.addDrawableRect("video", &grabber, 200, 150);

gui.addLabel("Loading images from disk");
gui.addDrawableRect("image loaded from dir", &img, 200, 150);

gui.addFileLister( mFilePathStr.set("Image Lister", ""), "of_logos/" );
gui.addDrawableRect("image loaded from dir", &img, 320, 240);

gui.setWhichColumn(1);
gui.addDrawableRect("colorCV", &colorCV, 200, 150);
auto lister = gui.addFileLister( mFilePathStr.set("Image Lister", ""), "of_logos/" );
lister->setDimensions(lister->getWidth(),200);

gui.setWhichColumn(2);
gui.addDrawableRect("grayscaleCV", &grayscaleCV, 200, 150);

gui.setWhichColumn(3);
gui.addDrawableRect("video", &grabber, 200, 150);
gui.addDrawableRect("colorCV", &colorCV, 200, 150);

//use ofParameterGroup to create sets of sliders/parameters
cvControls.setName("cv controls");
cvControls.add(bInvert.set("invert", false));
cvControls.add(threshold.set("threshold", 29.0, 1.0, 255.0));

gui.add( cvControls );

vector <string> names;
names.push_back("abs diff");
names.push_back("greater than");
names.push_back("less than");
gui.addTextDropDown(textDropDownParam.set("difference mode", 0), names);
gui.addTextDropDown(cvDiffMode.set("difference mode", 0), names);

gui.addDrawableRect("grayscaleCV", &grayscaleCV, 200, 150);

gui.setWhichColumn(3);
vars.setName("app vars");
vars.add( appFrameCount.set("frame count", 0) );
// vars.add( appFrameRate.set("frame rate", 60.0) );
vars.add( elapsedTime.set("elapsed time", 0.0) );

gui.addVariableLister(vars);
Expand Down Expand Up @@ -85,7 +83,6 @@ void ofApp::update(){
grayscaleCV.threshold(threshold, bInvert);
}

// appFrameRate = ofGetFrameRate();
elapsedTime = ofGetElapsedTimef();
appFrameCount = ofGetFrameNum();

Expand Down
2 changes: 1 addition & 1 deletion example/src/ofApp.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ofApp: public ofBaseApp{

ofParameter <string> testLabel;
ofParameter <string> status;
ofParameter<int> textDropDownParam;
ofParameter<int> cvDiffMode;

ofParameter<int> multiToggleParam;

Expand Down
2 changes: 1 addition & 1 deletion src/ofxControlPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ofxControlPanel: public guiBaseObject{
~ofxControlPanel();

//set the control panel name
void setup(string controlPanelName, float panelX = 0, float panelY = 0, float width = 1024, float height = 768, bool doSaveRestore = true, bool bPanelLocked = false);
void setup(string controlPanelName, float panelX = 0, float panelY = 0, float width = ofGetWidth(), float height = ofGetHeight(), bool doSaveRestore = true, bool bPanelLocked = false);

//add as many panels as you need
bool hasPanel( string aPanelName );
Expand Down

0 comments on commit ad32cca

Please sign in to comment.