Re: [fltk.development] fluid - Adding win32 icon

2013-03-25 Thread David FLEURY
Le 24/03/2013 22:41, Ian MacArthur a écrit :

 On 24 Mar 2013, at 17:59, David FLEURY wrote:

 Hi,
 I am  using fluid under win32, and I miss an icon for this application.
 I have done this patch to add an icon (only vs2010)
 May be there are others win32 users of fluid
 Regards,
 David

 This is a worthy idea, but I have some concerns about this version of the 
 patch:


 - I know it is normal for MS stuff to call the resource file just 
 resource.h, but it seems suspect to me; we should call it something that 
 makes it clearer what it is, even fluid_resource.h would be better, IMHO. 
 Also, there's cruft in there we do not need for the simple case of adding an 
 icon, anyway.


Ok I will try to fluid_resource.h filename and removing all unecessary 
lines.


 - fluid.rc needs cleaned up, there's a lot of (auto-generated?) extraneous 
 cruft in there that we don't need to just add an icon resource to a exe. 
 Actually, I'm not certain what's there will even work for any user who does 
 NOT have a French domain set on their build machine...


Yes, all auto generated. I will see to reduce this file too.


 - I can't comment on the patch to fluid.vcxproj; it is probably correct, but 
 since I only ever use the mingw tools for WinXX nowadays, I can't tell!


It should work on Visual Studio Express 2012 to check.
I have try it against up branch 1.3 of fltk


 - If we are going to do this, then the provided icon in the 
 fluid/icons/fluid.ico folder needs to be improved; it does not have enough of 
 the bigger sizes for the modern systems, so looks a bit duff most of the time.


Clearly, yes. I have not succeed to include the png provided into th 
resource. I am on it, But don't have good resource editor.

Another point, is Visual Studio 2012 project files are welcome ?
I have migrate (by duplicating) the existing one to VS 2012. If anyone 
is interested.

Regards,
David

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


Re: [fltk.development] FLTK '@' symbols question

2013-03-25 Thread Greg Ercolano
 Question:
  I want to verify that '@' symbols in labels (eg. @-) are only
  allowed at either *the very beginning* or *very end* of a string,
  or at both ends, and nothing else (ie. not in the middle of a
  string, or mixed into multiple lines).

   Another interesting thing about symbols I didn't know about
   @ symbols in labels, and I don't think is documented:

   The more lines in the string, the larger the symbol will be;
   the symbol is scaled to the size of all lines, and centered.

   Here comes some examples that use ascii art (view in a
   fixed width font!)

   If the label string is:

   @ Aaa\nBbb @

   You'll get:

   /| Aaa |\
   \| Bbb |/

   ..and if the string has more lines, e.g.

   @ Aaa\nBbb\nCcc\nDdd @

   ..then you'll get larger arrow symbols matching the height of all
   the lines:

/|   Aaa   |\
   / |   Bbb   | \
   \ |   Ccc   | /
\|   Ddd   |/

   ..instead of what I was *expecting*, which would have been:

  | Aaa
 Bbb
 Ccc
 Ddd |


   This behavior of symbols automatically centering + scaling
   should really be documented too.

   I had no idea symbols worked this way until I looked closely
   at the side effects of fl_measure's code.

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


Re: [fltk.development] FLTK '@' symbols question

2013-03-25 Thread MacArthur, Ian (Selex ES, UK)

 I'm working on fixing STR #2772 (removing extraneous code in
 fl_measure()) and need to understand in detail how we support '@'
 symbols in FLTK.


Eek! That seems brave! (To me, at least!)




Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England  Wales.  Company no. 02426132

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-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] fluid - Adding win32 icon

2013-03-25 Thread MacArthur, Ian (Selex ES, UK)

  - I know it is normal for MS stuff to call the resource file just
 resource.h, but it seems suspect to me; we should call it something
 that makes it clearer what it is, even fluid_resource.h would be
 better, IMHO. Also, there's cruft in there we do not need for the
 simple case of adding an icon, anyway.
 
 
 Ok I will try to fluid_resource.h filename and removing all unecessary
 lines.


I note that the Sudoku demo in the test folder calls these files sudokurc.h and 
sudoku.rc, though they have not been de-crufted as I was suggesting... That 
naming pattern might make sense though? At least to be consistent?

As far as I know (and I'm not exactly an expert here! Win32 is not my main 
thing...) then all you *need* to have in these files is something like...

--- my-icon_hdr.h --- 

// Win32 icon resource header file

#define IDI_ICON   101

// End of file

--- my-icon.rc ---

// Win32 icon resource file

#include my-icon_hdr.h

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICONICONDISCARDABLE media/my-icon.ico

// End of file


It seems that the rest of the stuff that is in there is not really necessary. I 
think...



  - If we are going to do this, then the provided icon in the
 fluid/icons/fluid.ico folder needs to be improved; it does not have
 enough of the bigger sizes for the modern systems, so looks a bit duff
 most of the time.
 
 
 Clearly, yes. I have not succeed to include the png provided into th
 resource. I am on it, But don't have good resource editor.

Is there not one built in to the VS tools? Last time I looked (which may have 
been VC6!) ISTR there was... Or maybe that's false memory syndrome?

In any case, the web seems to have plenty of tools for editing Win32 ico files, 
so you'll easily find something that works. 


 Another point, is Visual Studio 2012 project files are welcome ?
 I have migrate (by duplicating) the existing one to VS 2012. If anyone
 is interested.

Can VS12 cope with the existing project files? If so, we'd rather distribute 
(and maintain) the smallest set of project files that actually work, so if VS12 
can handle the existing project files correctly, then that is better for us.

That said, if you have working VS12 files, then maybe you can post them on an 
STR so that others can find them... You never know, someone might find them 
useful in the future.



Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England  Wales.  Company no. 02426132

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-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] fluid - Adding win32 icon

2013-03-25 Thread MacArthur, Ian (Selex ES, UK)

  Clearly, yes. I have not succeed to include the png provided into th
  resource. I am on it, But don't have good resource editor.
 
 Is there not one built in to the VS tools? Last time I looked (which
 may have been VC6!) ISTR there was... Or maybe that's false memory
 syndrome?
 
 In any case, the web seems to have plenty of tools for editing Win32
 ico files, so you'll easily find something that works.


Doh! I suppose it would have helped if I'd said what I actually use, too...

I use Matthias S. Benkmann's png2ico, which is a nice little command line 
tool for the job, you just make up your PNG's in the sizes you want then do:

   png2ico my-icon.ico image16x16.png image32x32.png (...etc...)

And that seems to do the trick just fine.




Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England  Wales.  Company no. 02426132

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-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] filename.h - struct dirent

2013-03-25 Thread Michael Baeuerle
David FLEURY wrote:
 Le 24/03/2013 13:16, Michael Baeuerle a écrit :
  David FLEURY wrote:
  
  Is your system with native 'struct dirent' a real Windows or do it
  masquerade as Windows?
 
 No, it's a masquerade to emulate it.
 
 On my side, I have unactivate one (the one from ACE framework).

If you find a way to detect your emulation, the switch can maybe
extended with something like:

#if defined(WIN32) ...  !defined(__ACE__)

to use the POSIX code path. But this is likely not sufficient.
#ifdef(WIN32) is used in many places, and I think FLTK expect the real
Windows behaviour in the other places too.


Regards,

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


Re: [fltk.development] FLTK '@' symbols question

2013-03-25 Thread Roman Kantor
Somewhat related, it would be nice if fl_add_symbol() would accept not only 
drawing functions but also images, even without additional scaling and 
rotations.
In the symbol table there is an int flag field (at the moment this flag is 
used only with values 0/1 to indicate scalable and non-scalable symbols), other
value could indicate that the pointer in the internal table is an image (or 
other object), not the function and have to be interpreted differently. This 
can be
done by overloading fl_add_symbol() which would set appropriate flag.

The reason for that is that it would simplify drawing icons for instance in 
menus. At the moment I am doing this by wrapping icon-drawing in symbol-like
wrapping functions (using some templates to automate instantiation of wrapping 
functions). The problem with it is that for each image/icon you need to 
implement
separate function wrapper. Having overloaded fl_add_symbol(const char * name, 
Fl_Image *, ...) could simplify that and allow drawing image as symbol in any
label just by adding it to the table and using @ convention within labels. To 
have the symbol API more comprehensive (and for istance remove destructed
images) it would require also to add a fl_remove_symbol() function.


Alternative approach would be that for instance @ convention would accept 
something like

   @file:///my/shared/image.png My Label

in which case the shared image (with proper size) would be instantiated and 
used automatically but in such a case there is a question when/where to keep 
track
of caches (shared images and their the reference counts) as zombie caches could 
still be alive after eg label change or widget destruction.

R.




On 24/03/2013 05:22, Greg Ercolano wrote:
 I'm working on fixing STR #2772 (removing extraneous code in fl_measure()) 
 and need to understand in detail how we support '@' symbols in FLTK.
 
 Question:
  I want to verify that '@' symbols in labels (eg. @-) are only
  allowed at either *the very beginning* or *very end* of a string,
  or at both ends, and nothing else (ie. not in the middle of a
  string, or mixed into multiple lines).
 
 So in other words, these are OK:
 
 @- Back
 Next @-
 @- He went that way @-
 @- Line one\nLine two\nLine three @-
 
 .and just about all other variations are not:
 
 Something @- different.
 This @- is @- a test.
 This is @-\na test

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


Re: [fltk.development] FLTK '@' symbols question [fl_add_symbol() RFE]

2013-03-25 Thread Greg Ercolano
[Changing the subject a bit to avoid a thread jack]

On 03/25/13 09:25, Roman Kantor wrote:
 Somewhat related, it would be nice if fl_add_symbol() would accept not only 
 drawing functions
 but also images, even without additional scaling and rotations.
 In the symbol table there is an int flag field (at the moment this flag is 
 used only
 with values 0/1 to indicate scalable and non-scalable symbols), other
 value could indicate that the pointer in the internal table is an image (or 
 other object),
 not the function and have to be interpreted differently. This can be
 done by overloading fl_add_symbol() which would set appropriate flag.

+1 from me -- sounds like a good approach, and I understand that
even though the symbol draw function can draw images, this won't
scale well when you have a lot of images (one func per image).

Making additional fl_add_symbol()/fl_remove_symbol() methods to accept
an image pointer and having those internally make use one of the unused
bits in the integer bit flag sounds like a good approach.

 Alternative approach would be that for instance @ convention would accept 
 something like
@file:///my/shared/image.png My Label

I prefer the image pointer approach for the reasons you mentioned,
and just it's better for modularity to have the image class handle
all the image related stuff.

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


Re: [fltk.development] fluid - Adding win32 icon

2013-03-25 Thread David FLEURY

 Another point, is Visual Studio 2012 project files are welcome ?
 I have migrate (by duplicating) the existing one to VS 2012. If anyone
 is interested.

 Can VS12 cope with the existing project files? If so, we'd rather distribute 
 (and maintain) the smallest set of project files that actually work, so if 
 VS12 can handle the existing project files correctly, then that is better for 
 us.

 That said, if you have working VS12 files, then maybe you can post them on an 
 STR so that others can find them... You never know, someone might find them 
 useful in the future.



If I read the README.IDE, I see :

The FLTK team limits support to the last two releases of any major IDE.

Even If we can still see VisualC6... *cough* My eyes are still burning :)

Time for the future ;)

And Yes, VS2012 can cope with VS2010. You can even choose to stay in old 
2010 mode or VS 2012 with new C++11 mode.

Another point, may be it will be clearer to create to Filter folder in 
the solution to put all the demos...mileage may vary.

Regards,
David

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


[fltk.development] RFC: Adding when() support in Fl_Tabs

2013-03-25 Thread Greg Ercolano
To solve STR#2939 Fl_Tabs not honoring when(FL_WHEN_NOT_CHANGED)
noticed that Fl_Tabs doesn't really make use of when() at all.

It seems to me tabs are very much like radio buttons, so it seems
it would make sense to model Fl_Tabs handling of when() after radio button's.

With radio buttons, the behavior is:

   0) FL_WHEN_NEVER   -- callback never invoked
   1) FL_WHEN_CHANGED -- invokes callback when click 
changes a button's state (no callback if no change)
   2) FL_WHEN_NOT_CHANGED -- invokes callback when click 
/doesn't/ change a button's state (no callback if change)
   3) FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED -- invokes callback when clicked if 
button changes state or not
   4) FL_WHEN_RELEASED-- if none of the above are set, 
callback invoked if button's state changes

In all cases, changed() reflects if a button changed state or not
(Fl_Tabs does this as well)

And like radio buttons, Fl_Tab's default when() value is FL_WHEN_RELEASED,
so the default behavior would be the same as it is now with that default.

Anyone see a problem with implementing this into Fl_Tabs?
I don't think there'd be any backwards compatible issues, and apps to date
shouldn't be messing with when() as to date behavior is not documented.
However, it may be prudent to protect the above 'new' behavior with a
macro (like FL_ABI_VERSION, or some such) if that might be an issue..
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] RFC: Adding when() support in Fl_Tabs

2013-03-25 Thread Greg Ercolano
On 03/25/13 19:37, Greg Ercolano wrote:
 With radio buttons, the behavior is:
 
0) FL_WHEN_NEVER   -- callback never invoked
1) FL_WHEN_CHANGED -- invokes callback when click 
 changes a button's state (no callback if no change)
2) FL_WHEN_NOT_CHANGED -- invokes callback when click 
 /doesn't/ change a button's state (no callback if change)
3) FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED -- invokes callback when clicked if 
 button changes state or not
4) FL_WHEN_RELEASED-- if none of the above are set, 
 callback invoked if button's state changes

Actually, some elaboration; tests revealed a subtlety I wasn't aware of:

A) If only WHEN_RELEASED is set,
   the callback is invoked only if there was a change *during button 
RELEASE event*

B) If only WHEN_CHANGED is set,
   the callback is invoked on change *during the button PUSH event*

C) If only WHEN_NOT_CHANGED is set,
   the callback is invoked on no change *during the button PUSH event*

D) If WHEN_RELEASED + WHEN_CHANGED,
   you can get *two callbacks* per click when a button changes state;
   WHEN_CHANGED causes an event on the PUSH event,
   WHEN_RELEASED causes an event on the RELEASE event.
   If the button didn't change, no event.

E) If WHEN_RELEASED + WHEN_NOT_CHANGED,
   if the button changed, you get a callback on *release* only,
   if the button didn't change, you'll get a callback on *RELEASE* only.

In the above:

(A) is obvious enough, and WHEN_RELEASED seems to imply WHEN_CHANGED.
(B) is interesting in that it seems to imply callbacks are done on
push events (unless WHEN_RELEASED is specified)
(C) is consistent with (B) for the not-changed state
(D) seems odd in that you can get two callbacks per click..
I would think WHEN_RELEASED implies I'd only get a callback on 
release
(E) seems correct in that WHEN_RELEASED causes the NOT_CHANGED callback 
on release only.

So is (D) a bug, or is that an intended side effect of (B)?

I must admit I had a dim understanding of the when() flags, because they
were always a bit thinly defined in the docs.

Trying to nail down my understanding of these flags to properly implement
Fl_Tabs, Fl_Table, and Fl_Tree..


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