From 4aa44a0b9159300c24db4786a3cf2e4198f168f1 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 28 May 2013 16:41:00 +0100 Subject: adding palete manipulation --- src/testApp.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/testApp.cpp') diff --git a/src/testApp.cpp b/src/testApp.cpp index bc2fe0e..c7bf35a 100755 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -11,6 +11,9 @@ void previewWindow::draw(){ for (auto i:parent->viewports) i.draw(parent->brightSlider); } +void previewWindow::dragEvent(ofDragInfo dragInfo, ofxFenster* win){ + parent->dragEvent(dragInfo); +} //-------------------------------------------------------------- guiWindow::~guiWindow(){ cout << "gui window destroyed" << endl; @@ -24,6 +27,9 @@ void guiWindow::draw(){ parent->gui.draw(); } +void guiWindow::dragEvent(ofDragInfo dragInfo, ofxFenster* win){ + parent->dragEvent(dragInfo); +} //-------------------------------------------------------------- void testApp::create1port(bool & pressed){ if (!pressed) return; @@ -220,6 +226,18 @@ void testApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- +void testApp::dragEvent(ofDragInfo dragInfo, ofxFenster* win){ + dragEvent(dragInfo); +} +void testApp::dragEvent(ofDragInfo dragInfo){ + printf("got draginfo: %s\n",dragInfo.files[0].c_str()); + int sta=dragInfo.files[0].find_last_of("\\/")+1; + int len=(dragInfo.files[0].find_last_of(".")+4)-sta; + string filename=dragInfo.files[0].substr(sta,len); + printf("loading %s\n",filename.c_str()); + + if (filename.length()) control.loadpalette(filename); +} void testApp::mousePressedEvent(ofMouseEventArgs &args) { -- cgit v1.2.3