From 1a4a66963e5899a973bbcd20f2101d75765987a9 Mon Sep 17 00:00:00 2001 From: Comment Date: Thu, 27 Dec 2012 01:00:15 +0000 Subject: basic key commands all good --- src/testApp.cpp | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/testApp.cpp b/src/testApp.cpp index 22c2897..2147e71 100755 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -16,17 +16,15 @@ maybe draw into an FBO in order to put a window in a window method to retreive text as a single string with \n's -special key functions including ENTER, BACKSPACE, DELETE, ARROW KEYS - -drawing functionality: make line breaks (easier with mono font) - set box size - draw scrollbar & set scrollpoint - drag to scroll +architecture :- text editor in a box or a window? + insertion point/ selection - set with mouse - get and set clipboard (ofxFensterManager.h) - - + + vector insert a problem performance wise? you need to use an iterator to insert into a vector anyway- may as well use a list @@ -81,10 +79,34 @@ void editorWindow::draw(){ #define OF_KEY_INSERT */ void editorWindow::keyPressed(int key){ + //printf("%i\n",key); vector::iterator i; string t; int l; switch (key) { + case OF_KEY_DEL: + if (insertionPoint.columninsertionPoint.row) { + if (insertionPoint.row