Re: [fltk.development] text caret control in Fl_Text_Display++

2012-05-26 Thread Greg Ercolano
 How do you specify D::C::A ?

I hesitate to answer, because it's OT for the list,
and q's about the C++ language tend to become large
threads no matter how hard one tries to prevent it.

So if you have more q's about C++ or need elaboration,
google for C++ tutorials multiple inheritance.

FWIW:

#include stdio.h
class X {
public:
X() { }
void hello() { printf(Class X\n); }
};
class Y {
public:
Y() { }
void hello() { printf(Class Y\n); }
};
class Z : public X, public Y {
public:
   Z() : X(), Y() { }
   void hello() { printf(Class Z\n); }
};
int main() {
Z z;
z.Z::X::hello();// prints Class X
z.Z::Y::hello();// prints Class Y
z.Z::Z::hello();// prints Class Z
return(0);
}
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display++

2012-05-24 Thread Greg Ercolano
On 05/23/12 10:29, David Currie wrote:
   MyTextWindow(int W, int H,const char* l)
   : Fl_Window(W,H,l), MyTextDisplay(20,20,W-40,H-40,NULL)
   {
 Fl_Window::label(l);
 Fl_Window::add(this);  // Compile error  : ambiguous base class Fl_Widget

Don't even do the add(); it's not needed. (**)

FWIW, I wouldn't use multiple inheritance anyway, I'd just derive
from Fl_Window, and make MyTextDisplay a protected/private member,
and provide methods to manipulate the member separately, or provide
a single method that lets app code access it directly. That's the
common technique in FLTK apps, and is indeed how FLTK implements its
own derived widgets.

** add() is implied because Fl_Window::begin() is implied,
   which handles add()ing all widgets that follow automatically
   until an end().

   So for instance, the following code:

Fl_Window win(..);
MyTextDisplay myt(..);
win.end();

..really ends up being:

Fl_Window win(..);
win.begin();// THIS IS IMPLIED
  MyTextDisplay myt(..);// automatically a child of the win due to 
implied win.begin()
win.end();  // end() the auto-parenting behavior of the 
Fl_Window
..

..which by definition does an add() already, so including an add()
after the MyTextDisplay declaration is redundant.
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display++

2012-05-23 Thread David Currie
 On 05/16/12 22:59, Greg Ercolano wrote:
  What's the goal: is it to add up/dn/lt/rt key control
  to the caret position of the text display widget?

My goals are
0) to (re)/place (fg,bg) color text anywhere in the text display widget (TDW)
1) to grab ALL keys from the TDW
2) to move/show/hide the caret anywhere in the TDW
   All above are INDEPENDENT of each other
 
  If so, I'd think you'd want to derive a class from
  Fl_Text_Display to handle() the key events.

 This seems to work reliably wrt to displaying the caret,
 and doesn't seem to need the explicit take_focus() call.
   CORRECT !
 This is probably because here we're responding to FL_FOCUS/UNFOCUS,
 and I'm calling redraw() on those events to properly show/hide
 the cursor, which is probably why Fl_Text_Display wasn't drawing
 the caret correctly. (Showing the caret in Fl_Text_Display was
 probably never tested during its development)

  For what I need I found I didn't even need redraw() see below.

 This example just shows adding caret cursor motion for
 up/dn/lt/right keys. It doesn't show copy selection, etc.
 But hopefully that too is easily added by checking the state keys,
 ie. checking Fl::event_state() for FL_SHIFT, FL_CTRL, etc.

 The following should be a good start.

 #include FL/Fl.H
 #include FL/Fl_Window.H
 #include FL/Fl_Text_Display.H
 //
 // Add up/dn/lt/rt keynav to Fl_Text_Display caret cursor -erco 5/16/12
 //
 class MyTextDisplay : public Fl_Text_Display {
 public:
   MyTextDisplay(int X,int Y,int W,int H,const char*L=0) : 
 Fl_Text_Display(X,Y,W,H,L)   {
 show_cursor();  // ENABLE CURSOR
 cursor_color(0xFF00);   // CURSOR RED
 cursor_style(Fl_Text_Display::HEAVY_CURSOR);
 //take_focus(); // UNNEEDED
   }
   int handle(int e) {
 int ret = Fl_Text_Display::handle(e);   // let text display handle 
 event first
 switch (e) {
   case FL_FOCUS:
   case FL_UNFOCUS:
   case FL_KEYUP:
 redraw();   // show/hide cursor
Both lines above I did without!
 return 1;
   case FL_KEYBOARD: {
 switch (Fl::event_key()) {
   case FL_Up:printf(UP\n);move_up();break;
   case FL_Down:  printf(DOWN\n);  move_down();  break;
   case FL_Left:  printf(LEFT\n);  move_left();  break;
   case FL_Right: printf(RIGHT\n); move_right(); break;
 }
  for my needs I would just steal all keys here deleting above 4 lines
 break;
   }
 }
 return(ret);
   }
 };
 int main() {
   Fl_Window   *win   = new Fl_Window(640,480,Display);
   MyTextDisplay   *mDisp = new MyTextDisplay(20,20,640-40,480-40);
   Fl_Text_Buffer  *mBuff = new Fl_Text_Buffer();
   mDisp-buffer(mBuff);
   mBuff-text(line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n);
   mDisp-insert_position(5);
   win-end();
   win-show();
   return Fl::run();
 }

This Method (at first testing) works CLEANLY.
It WORKS because keys(events) are taken from Fl_Text_Display (NOT Fl_Window)
This is ALL MY FAULT as I just assumed (from examples)
that events HAD to be taken from the Fl_Window. This is clearly wrong.

I do have one follow up question though.
I am currently trying to flesh out a class TextWindow
(obviously simplified)

class MyTextDisplay : public Fl_Text_Display
{
private:
  // ... etc
public:
  MyTextDisplay(int X,int Y,int W,int H,const char* l)
  : Fl_Text_Display(X,Y,W,H,l) {
  // ...
  }
  // ... methods (trap keys, show/hideCursor(pos), replaceText etc)
};

class MyTextWindow: public Fl_Window, MyTextDisplay
{
public:
  MyTextWindow(int W, int H,const char* l)
  : Fl_Window(W,H,l), MyTextDisplay(20,20,W-40,H-40,NULL)
  {
Fl_Window::label(l);
Fl_Window::add(this);  // Compile error  : ambiguous base class Fl_Widget
//  Fl_Window::add(this-MyTextDisplay) ??
//(MyTextDisplay::) ??
// I know what I want to do here but I just don't know C++ well enough
// for the correct syntax
  }
  // ...
};

If necessary I can work around the above syntax issue,
but if someone knows the correct syntax I would be grateful.
I intend to make this TextWindow a class so it can appear/disappear.
I seem to recall reading a posting that someone wanted a window that can 
appear/disappear.
More of that later.


___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-17 Thread Greg Ercolano
What's the goal: is it to add up/dn/lt/rt key control
to the caret position of the text display widget?

If so, I'd think you'd want to derive a class from
Fl_Text_Display to handle() the key events.

This, instead of deriving from Fl_Window.

When a widget has focus, in this case Fl_Text_Display,
it gets first shot at the events, and it may consume them.
In fact, it may try to take all keyboard events when it
has focus, which would probably explain why the Fl_Window
derived class isn't getting them.


On 05/15/12 06:41, David Currie wrote:
 #include FL/Fl.H
 #include FL/Fl_Window.H
 #include FL/Fl_Text_Display.H
 #define USING_CARET
 class EventWindow : public Fl_Window
 {
 private:
   Fl_Text_Buffer*  mBuff;
   Fl_Text_Display* mDisp;
   bool   mKeyPressed;
   unsigned longmKey;
   int handle_keydn(int event, int key, int state);
 public:
   EventWindow();
   bool getKey(unsigned long pKey);
   int handle(int pEvent);
 #ifdef USING_CARET
   void showCaret(int pPos);
 #endif
 };
 EventWindow::EventWindow() : Fl_Window(640,480,Display)
 {
   mBuff = new Fl_Text_Buffer();
   mDisp = new Fl_Text_Display(20,20,640-40,480-40);
   mDisp-buffer(mBuff); add(*mDisp);
   mBuff-text(line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n);
   mKeyPressed = false;
   mKey = 0;
 }
 int EventWindow::handle(int pEvent)
 {
   switch (pEvent) {
 case FL_FOCUS: case FL_UNFOCUS: case FL_KEYUP:
   return 1;
 case FL_KEYBOARD:
   return handle_keydn(pEvent,Fl::event_key(),Fl::event_state());
 default:
   return Fl_Window::handle(pEvent);
   };
 }
 int EventWindow::handle_keydn(int pEvent, int pKey,int pState)
 {
 printf(KeyDN Key = %d State = %d\n,pKey,pState);fflush(stdout);
   mKey = (unsigned long)pState + (unsigned long)pKey;
   mKeyPressed = true;
   return 1;
 }
 bool EventWindow::getKey(unsigned long pKey)
 {
   bool lRet = false;
   if (mKeyPressed)
   {
 switch (mKey)
 {
   default:
   pKey = mKey;
   lRet = true;
   case 0xFFE3: // left ctrl
   case 0xFFE4: // righ ctrl
   case 0xFFE9: // left alt
   case 0xFFEA: // left alt
   case 0xFFE1: // left shift
   case 0xFFE2: // righ shift
   break;
 }
 mKeyPressed = false;
 mKey = 0;
   }
   return lRet;
 }
 #ifdef USING_CARET
 void EventWindow::showCaret(int pPos)
 {
   mDisp-show_cursor();  // ENABLE CURSOR
   mDisp-cursor_color(0xFF00); // CURSOR RED
   mDisp-cursor_style(Fl_Text_Display::HEAVY_CURSOR);
   mDisp-insert_position(pPos); // POSITION
   mDisp-take_focus(); // SHOW CARET ON STARTUP (EVEN IF NOT IN FOCUS)
 }
 #endif
 int main()
 {
   EventWindow* win  = new EventWindow();
   win-show();
   int lPos = 5;
 #ifdef USING_CARET
   win-showCaret(lPos);
 #endif
   int lRet = 0;
   while (1)
   {
 lRet = Fl::wait();
 unsigned long lKey = 0;
 if (win-getKey(lKey))
 {
   ++lPos;
   printf( lPos = %d\n,lPos);fflush(stdout);
 #ifdef USING_CARET
   win-showCaret(lPos);
 #endif
 }
 if (!lRet)
 {
   break;
 }
   }
   return Fl::run();
 }

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-17 Thread Greg Ercolano
On 05/16/12 22:59, Greg Ercolano wrote:
   What's the goal: is it to add up/dn/lt/rt key control
   to the caret position of the text display widget?
 
   If so, I'd think you'd want to derive a class from
   Fl_Text_Display to handle() the key events.

This seems to work reliably wrt to displaying the caret,
and doesn't seem to need the explicit take_focus() call.

This is probably because here we're responding to FL_FOCUS/UNFOCUS,
and I'm calling redraw() on those events to properly show/hide
the cursor, which is probably why Fl_Text_Display wasn't drawing
the caret correctly. (Showing the caret in Fl_Text_Display was
probably never tested during its development)

This example just shows adding caret cursor motion for
up/dn/lt/right keys. It doesn't show copy selection, etc.
But hopefully that too is easily added by checking the state keys,
ie. checking Fl::event_state() for FL_SHIFT, FL_CTRL, etc.

The following should be a good start.

#include FL/Fl.H
#include FL/Fl_Window.H
#include FL/Fl_Text_Display.H
//
// Add up/dn/lt/rt keynav to Fl_Text_Display caret cursor -erco 5/16/12
//
class MyTextDisplay : public Fl_Text_Display {
public:
  MyTextDisplay(int X,int Y,int W,int H,const char*L=0) : 
Fl_Text_Display(X,Y,W,H,L)   {
show_cursor();  // ENABLE CURSOR
cursor_color(0xFF00);   // CURSOR RED
cursor_style(Fl_Text_Display::HEAVY_CURSOR);
//take_focus(); // UNNEEDED
  }
  int handle(int e) {
int ret = Fl_Text_Display::handle(e);   // let text display handle 
event first
switch (e) {
  case FL_FOCUS:
  case FL_UNFOCUS:
  case FL_KEYUP:
redraw();   // show/hide cursor
return 1;
  case FL_KEYBOARD: {
switch (Fl::event_key()) {
  case FL_Up:printf(UP\n);move_up();break;
  case FL_Down:  printf(DOWN\n);  move_down();  break;
  case FL_Left:  printf(LEFT\n);  move_left();  break;
  case FL_Right: printf(RIGHT\n); move_right(); break;
}
break;
  }
}
return(ret);
  }
};
int main() {
  Fl_Window   *win   = new Fl_Window(640,480,Display);
  MyTextDisplay   *mDisp = new MyTextDisplay(20,20,640-40,480-40);
  Fl_Text_Buffer  *mBuff = new Fl_Text_Buffer();
  mDisp-buffer(mBuff);
  mBuff-text(line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n);
  mDisp-insert_position(5);
  win-end();
  win-show();
  return Fl::run();
}
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-15 Thread David Currie
  Before I discuss caret behavior.
  I have a further related issue (it's all bound up in the same widget).

 The Fl_Double_Window does not get keyboard focus by default. You can =
 achieve that by returning 1 for FL_FOCUS and FL_UNFOCUS events.

 Fl_Input_ and derived widgets and Fl_Text_Display do that for you.=


Apologies and thanks to Matthias for FOCUS:UNFOCUS:return 1 advice.
  I had been cutting and splicing and didnt realise its importance.

Nevertheless there is STILL a PROBLEM. Sorry but I have to show

#include FL/Fl.H
#include FL/Fl_Window.H
#include FL/Fl_Text_Display.H
#define USING_CARET
class EventWindow : public Fl_Window
{
private:
  Fl_Text_Buffer*  mBuff;
  Fl_Text_Display* mDisp;
  bool mKeyPressed;
  unsigned longmKey;
  int handle_keydn(int event, int key, int state);
public:
  EventWindow();
  bool getKey(unsigned long pKey);
  int handle(int pEvent);
#ifdef USING_CARET
  void showCaret(int pPos);
#endif
};
EventWindow::EventWindow() : Fl_Window(640,480,Display)
{
  mBuff = new Fl_Text_Buffer();
  mDisp = new Fl_Text_Display(20,20,640-40,480-40);
  mDisp-buffer(mBuff); add(*mDisp);
  mBuff-text(line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n);
  mKeyPressed = false;
  mKey = 0;
}
int EventWindow::handle(int pEvent)
{
  switch (pEvent) {
case FL_FOCUS: case FL_UNFOCUS: case FL_KEYUP:
  return 1;
case FL_KEYBOARD:
  return handle_keydn(pEvent,Fl::event_key(),Fl::event_state());
default:
  return Fl_Window::handle(pEvent);
  };
}
int EventWindow::handle_keydn(int pEvent, int pKey,int pState)
{
printf(KeyDN Key = %d State = %d\n,pKey,pState);fflush(stdout);
  mKey = (unsigned long)pState + (unsigned long)pKey;
  mKeyPressed = true;
  return 1;
}
bool EventWindow::getKey(unsigned long pKey)
{
  bool lRet = false;
  if (mKeyPressed)
  {
switch (mKey)
{
  default:
pKey = mKey;
lRet = true;
case 0xFFE3: // left ctrl
case 0xFFE4: // righ ctrl
case 0xFFE9: // left alt
case 0xFFEA: // left alt
case 0xFFE1: // left shift
case 0xFFE2: // righ shift
break;
}
mKeyPressed = false;
mKey = 0;
  }
  return lRet;
}
#ifdef USING_CARET
void EventWindow::showCaret(int pPos)
{
  mDisp-show_cursor();  // ENABLE CURSOR
  mDisp-cursor_color(0xFF00); // CURSOR RED
  mDisp-cursor_style(Fl_Text_Display::HEAVY_CURSOR);
  mDisp-insert_position(pPos); // POSITION
  mDisp-take_focus(); // SHOW CARET ON STARTUP (EVEN IF NOT IN FOCUS)
}
#endif
int main()
{
  EventWindow* win  = new EventWindow();
  win-show();
  int lPos = 5;
#ifdef USING_CARET
  win-showCaret(lPos);
#endif
  int lRet = 0;
  while (1)
  {
lRet = Fl::wait();
unsigned long lKey = 0;
if (win-getKey(lKey))
{
  ++lPos;
  printf( lPos = %d\n,lPos);fflush(stdout);
#ifdef USING_CARET
  win-showCaret(lPos);
#endif
}
if (!lRet)
{
  break;
}
  }
  return Fl::run();
}

try commenting out #define USING_CARET

1) trap keys in (Fl_Window/Double_Window) using above etc, WORKS OK (all keys 
produce keydown).
2) add Fl_Text_Display to (1) WORKS OK (all keys produce keydown).
3) add caret functionality using Greg's showCaret instructions
  DOESN'T WORK (not all keys produce keydown). Is this related to take_focus()?

  What is going on ??



___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-14 Thread David Currie
 On 05/11/12 10:11, Greg Ercolano wrote:
  On 05/11/12 06:32, Matthias Melcher wrote:
  If there's bugs/shortcomings with Fl_Text_Display's
  caret + keynav, we should probably fix it, so that it
  can be a fully functional replacement for Fl_Multiline_Output.
 
  I did notice, as David did, that the caret would sometimes
  not appear. I found if the window opened when my mouse wasn't in it,
  the caret wouldn't appear. And moving the mouse INTO the window
  didn't make it appear.

 I've opened STR#2844 for this on David's behalf for this
 to be investigated.

 The Fl_Text_XXX widgets seem pretty complex under the hood,
 so I'm leaving it open for someone to investigate who's familiar
 with it.

Before I discuss caret behavior.
I have a further related issue (it's all bound up in the same widget).
I need to trap all keystrokes so

#include FL/Fl.H
#include FL/Fl_Double_Window.H
#include FL/Fl_Text_Display.H
class EventWindow : public Fl_Double_Window
{
private:
//  Fl_Text_Buffer*  buff;
//  Fl_Text_Display* disp;
  int handle_keyup(int event, int key, int state);
  int handle_keydn(int event, int key, int state);
public:
  EventWindow();
  int handle(int e);
};

EventWindow::EventWindow() : Fl_Double_Window(640,480,Display)
{
//  buff = new Fl_Text_Buffer();
//  disp = new Fl_Text_Display(20,20,640-40,480-40);
//  disp-buffer(buff); add(*disp); show();
//  buff-text(line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n);
}
int EventWindow::handle(int event)
{
  switch (event) {
case FL_KEYUP:
return handle_keyup(event,Fl::event_key(),Fl::event_state());
case FL_KEYBOARD:
return handle_keydn(event,Fl::event_key(),Fl::event_state());
default:
  return Fl_Double_Window::handle(event);
  };
}
int EventWindow::handle_keydn(int pEvent, int pKey,int pState)
{
printf(KeyDN Key = %d State = %d\n,pKey,pState);fflush(stdout);
return 1;
}
int EventWindow::handle_keyup(int pEvent, int pKey,int pState)
{
printf(KeyUP Key = %d State = %d\n,pKey,pState);fflush(stdout);
return 1;
}
int main()
{
  EventWindow* win  = new EventWindow();
  win-show();
  return Fl::run();
}

Running the program as is You get a keyup for all keys.
Removing all comments and NOW (KP_arrows, arrows, 
KP_home,KP_end,home,end,others??)
generate a KEYUP BUT NOT a KEYDOWN(KEYBOARD). I don't understand ?

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-11 Thread Matthias Melcher

On 11.05.2012, at 03:58, David Currie wrote:

 On 05/10/12 06:07, David Currie wrote:
 How does one control the text caret in Fl_Text_Display.
 I mean the TEXT cursor (caret) not the mouse cursor ?
 
  To control its on/off state, show_cursor(1|0),
  To control its position, insert_position(pos).
 
 is there some example code because I can't get ANY cursor
 to show ?

Use Fl_Text_Editor. That one has a cursor. Or use Fl_Output, which has a 
minimal little cursor and is output-only.
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-11 Thread Greg Ercolano
On 05/11/12 06:32, Matthias Melcher wrote:
 
 On 11.05.2012, at 03:58, David Currie wrote:
 
 On 05/10/12 06:07, David Currie wrote:
 How does one control the text caret in Fl_Text_Display.
 I mean the TEXT cursor (caret) not the mouse cursor ?

 To control its on/off state, show_cursor(1|0),
 To control its position, insert_position(pos).

 is there some example code because I can't get ANY cursor
 to show ?
 
 Use Fl_Text_Editor. That one has a cursor.

I'm assuming he wants a readonly scrollable display.

 Or use Fl_[Multiline]_Output,
 which has a minimal little cursor and is output-only.

IIRC, trouble with Fl_*_Output is no scrollbars.

I moved a lot of stuff away from that widget
just to get the scrollbars.

If there's bugs/shortcomings with Fl_Text_Display's
caret + keynav, we should probably fix it, so that it
can be a fully functional replacement for Fl_Multiline_Output.

I did notice, as David did, that the caret would sometimes
not appear. I found if the window opened when my mouse wasn't in it,
the caret wouldn't appear. And moving the mouse INTO the window
didn't make it appear.

I had to add 'take_focus()' to make it show up when the window
opened without the mouse in it. (On my linux system, the
window manager uses focus follows mouse)
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-11 Thread Greg Ercolano
On 05/11/12 10:11, Greg Ercolano wrote:
 On 05/11/12 06:32, Matthias Melcher wrote:
   If there's bugs/shortcomings with Fl_Text_Display's
   caret + keynav, we should probably fix it, so that it
   can be a fully functional replacement for Fl_Multiline_Output.
 
   I did notice, as David did, that the caret would sometimes
   not appear. I found if the window opened when my mouse wasn't in it,
   the caret wouldn't appear. And moving the mouse INTO the window
   didn't make it appear.

I've opened STR#2844 for this on David's behalf for this
to be investigated.

The Fl_Text_XXX widgets seem pretty complex under the hood,
so I'm leaving it open for someone to investigate who's familiar
with it.
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-10 Thread Greg Ercolano
On 05/10/12 06:07, David Currie wrote:
 How does one control the text caret in Fl_Text_Display.
 I mean the TEXT cursor (caret) not the mouse cursor ?

To control its on/off state, show_cursor(1|0),
To control its position, insert_position(pos).

For the user to move it, you click the mouse
where you want it to be.

Oddly, I don't think there's a way for the user
to use keyboard navigation to control the caret's position;
I think it only responds to ^A (select all) and ^C (copy).

As a side note to the devs: is it an omission that there
appears to be no way for the user to use keyboard nav
(like there is with Fl_Multiline_Output) to control
the copy/paste caret?
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] text caret control in Fl_Text_Display

2012-05-10 Thread David Currie
 On 05/10/12 06:07, David Currie wrote:
  How does one control the text caret in Fl_Text_Display.
  I mean the TEXT cursor (caret) not the mouse cursor ?

   To control its on/off state, show_cursor(1|0),
   To control its position, insert_position(pos).

is there some example code because I can't get ANY cursor
to show ?

   For the user to move it, you click the mouse
   where you want it to be.

   Oddly, I don't think there's a way for the user
   to use keyboard navigation to control the caret's position;
   I think it only responds to ^A (select all) and ^C (copy).

   As a side note to the devs: is it an omission that there
   appears to be no way for the user to use keyboard nav
   (like there is with Fl_Multiline_Output) to control
   the copy/paste caret?

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev