[fltk.bugs] [MOD] STR #2930: drag and drop from Mozilla Gecko apps broken

2013-02-06 Thread Aaron M . Ucko

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2930
Version: 1.3.2


Dragging and dropping from an application using Mozilla's Gecko engine
(such as Seamonkey/Iceape) yields a single  character; it seems that the
first two source types it offers are private text/_moz_* types encoded as
either UTF-16 or UCS-2, but FLTK doesn't detect the encoding and stops at
the first internal NUL byte.  The proper fix is presumably to ignore the
private types, though recognizing UTF-16 or UCS-2 could also be helpful.

You can find a detailed report at http://bugs.debian.org/699860; I've been
able to reproduce the problem with 1.3.2 as well, but not yet had time to
look into the actual code.


Link: http://www.fltk.org/str.php?L2930
Version: 1.3.2

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


[fltk.general] Detect Resizing

2013-02-06 Thread Robert W
Hi there,

How can I detect Window resizing since it doesn't provide any resize events or 
callbacks from what I've read?

I'm current writing my first FLTK program for a 2D game and I want to remove 
the scrollbars when they aren't required. This is when the width or height of 
the world can be fully displayed in an FL_GL_Widget.

I know that I could simply put the FL_GL_Widget within an FL_Scroll for this 
task however this seems a bit on the hacky side to me as this would either mean 
redrawing the whole widget for a small area or dealing with FLTK's damage 
variables. The former isn't efficient and when it comes to the latter, its been 
advised not to do partial screen updates using an OpenGL context.

As the FL_GL_Widget is set as the window's resizable(), I can can use valid() 
within draw() to check when the window has been resized. While this works fine 
for updating the scrollbar values, when it comes to resizing the widget itself 
to use or free up space for the scrollbar(s), I'm finding that this is causes 
flicking and drawing problems. This makes sense since the widget is being 
resized within its own drawing function.

To give you a visual, here's a link to a screenshot of the window; 
http://i49.tinypic.com/2mdgfhy.png

In this picture, I don't require the bottom scrollbar and would like it removed.

It's stated in the manual that one can achieve any type of resizing by using an 
invisible Fl_Box, however how can I get the event or callback when it does 
resize?

Thanks to any replies. Hopefully my question wasn't too stupid.
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Detect Resizing

2013-02-06 Thread MacArthur, Ian (Selex ES, UK)

 How can I detect Window resizing since it doesn't provide any resize
 events or callbacks from what I've read?
 
 I'm current writing my first FLTK program for a 2D game and I want to
 remove the scrollbars when they aren't required. This is when the width
 or height of the world can be fully displayed in an FL_GL_Widget.

FL_GL_Widget ? 

I assume you are deriving your own window class from Fl_Gl_Window then?

If so, can you not just override the resize() method in your derived class and 
then use that to detect resize events happening?

Or am I missing the point here?




This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.


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


Re: [fltk.general] Detect Resizing

2013-02-06 Thread Edzard Egberts
 How can I detect Window resizing since

It's a virtual method of the window. My way to use this method directing 
resize to a main program:

struct i_callback
{ // main program should be inherited: class main: public i_callback
  // and overwrite Resize():
virtual void Resize(int x, int y, int w, int h)= 0;
};

class Fl_Resize_Window: public Fl_Double_Window
{ // Window with extended resize() method to replace Fl_Double_Window
public:
Fl_Resize_Window(int w, int h, const char* l= 0):
Fl_Double_Window(w, h, l)
{}

Fl_Resize_Window(int x, int y, int w, int h, const char* l= 0):
Fl_Double_Window(x, y, w, h, l)
{}

virtual ~Fl_Resize_Window() {}

inline void Callback(i_callback* pC){ mp_Callback= pC; }

protected:
i_callback* mp_Callback;

virtual void resize(int x, int y, int w, int h)
{
Fl_Double_Window::resize(x, y, w, h);
if (mp_Callback) mp_Callback-Resize(x, y, w, h);
}
};
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Detect Resizing

2013-02-06 Thread Edzard Egberts
Ups, forgot to initialise, must be:

 Fl_Resize_Window(int w, int h, const char* l= 0):
 Fl_Double_Window(w, h, l),
   mp_Callback(0)
 {}

 Fl_Resize_Window(int x, int y, int w, int h, const char* l= 0):
 Fl_Double_Window(x, y, w, h, l),
   mp_Callback(0)
 {}
___
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk


Re: [fltk.general] Detect Resizing

2013-02-06 Thread Robert W
Hi Ian,

Thanks for the very quick response.

Turns out it was a stupid question. I wasn't aware that could override the 
resize method although now I that I think about it, nothing had said otherwise.


  How can I detect Window resizing since it doesn't provide any resize
  events or callbacks from what I've read?
  =

  I'm current writing my first FLTK program for a 2D game and I want to
  remove the scrollbars when they aren't required. This is when the width
  or height of the world can be fully displayed in an FL_GL_Widget.

 FL_GL_Widget ? =


 I assume you are deriving your own window class from Fl_Gl_Window then?

 If so, can you not just override the resize() method in your derived class =
 and then use that to detect resize events happening?

 Or am I missing the point here?



 
 This email and any attachments are confidential to the intended
 recipient and may also be privileged. If you are not the intended
 recipient please delete it from your system and notify the sender.
 You should not copy it or use it for any purpose nor disclose or
 distribute its contents to any other person.
 


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


Re: [fltk.general] Detect Resizing

2013-02-06 Thread MacArthur, Ian (Selex ES, UK)

 Turns out it was a stupid question.

There are no stupid questions...

(Well, not the first time anyway: Ask the same thing 6 times, I might change my 
opinion...!  ;-)  )

 I wasn't aware that could override
 the resize method although now I that I think about it, nothing had
 said otherwise.


Yup, override is probably the way (indeed, at certain levels in the hierarchy, 
the resize method is explicitly virtual, to encourage override, but that maybe 
is not obvious if you are looking at the Fl_Gl_Window docs, of course...)

I think Edzard's example in his post is useful here, in that it makes the point 
about calling the base class resize(); as well as doing whatever actions you 
add - this is an important point that often gets missed, and failing to call 
the base class methods does often lead to unexpected behaviours that can be 
hard to debug, so...

Also, he shows how you can use that to trigger a callback - though in your case 
you may be able to do what you need directly in the resize() method itself?

Another tricky little wrinkle to this can be what happens if the resize() 
method itself causes the view to be resized (e.g. by removing some feature, 
such as, say, a scrollbar...) Does that then trigger a recursion...? Somethimes 
you need to watch out for that too, though I'd guess you'll be fine in this 
case.

Cheers, hope that helps...





This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.


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


[fltk.general] Fl_Sys_Menu_Bar not honouring programmatic updates to check boxes

2013-02-06 Thread Ian MacArthur
(Maybe one for Manolo?)

I have an app that, in its menu structure, has some FL_MENU_TOGGLE entries that 
show a check mark... Now, depending on various happenings within the code, 
these check marks may be set or cleared programmatically at runtime, using e.g. 
item-set(); and item-clear();

All well and good - except on OSX where I am using Fl_Sys_Menu_Bar, where the 
changes to the state of the toggles are never shown by the menus...

Though if I query the menu items internally they do report the state toggling, 
and if I click on the check items, they respond as if they had the internal 
state rather than the displayed state... That is, if the menu shows a check 
mark, but internally that item is clear, then clicking on the item causes it to 
be updated to the set state... Then clicking it again clears it...

Of course, the same code appears to be fine on X11 and WIN32 so this does seem 
to be a feature of Fl_Sys_Menu_Bar.

Anyone else seeing this? Is there a workaround? How do I cause the 
Fl_Sys_Menu_Bar to be refreshed to reflect the actual state?

I guess this may be a bug? Or is this Just The Way Things Are on OSX and we are 
stuck with it?

Cheers,
-- 
Ian



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


[fltk.general] Code into Fl_group ?

2013-02-06 Thread Pierre
Hi,

I'm new in fltk programming. I have the following problem with my code :

I have a button that allows me to upload a specific object in a Fl_group named 
test:

 Fl_Button {} {
label {Show Voice Parameters}
callback 
{ADnoteVoice-position(541,35);test-add(ADnoteVoice);ADnoteVoice-show();}
xywh {5 400 170 25} labelsize 12

  }
This code run well.
The problem is: I want the object loads automatically without the need to click 
on the this button . I have tested this
Fl_Group test  {
label {VOICE PARAMETERS} open
xywh {540 5 768 922} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 
labelsize 13 align 17
   code0 
{ADnoteVoice-position(541,35);test-add(ADnoteVoice);ADnoteVoice-show();}.
The compilation is alright, but nothing occur.

  }

What is wrong ?

Thanks

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