Commit Graph

113 Commits

Author SHA1 Message Date
Albrecht Schlosser
3d90148065 Remove leading underscore from labeltype(s) in new demo.
Since svn r12443 we can use all labeltypes (including FL_IMAGE_LABEL and
FL_MULTI_LABEL) w/o leading underscore. We can also use both documented
variants to assign an FL_MULTI_LABEL to an Fl_Menu_Item.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12444 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-11 19:06:32 +00:00
Greg Ercolano
2670903db9 Simplified the example's menu item callback.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12442 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-11 18:36:35 +00:00
Greg Ercolano
2a41af1fc3 Applied Manolo's recommendation (fltk.coredev), removing unnecessary item->image(*pixmap) call.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12441 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-11 18:12:58 +00:00
Greg Ercolano
88204a5524 Added example code to demonstrate Fl_Multi_Label for STR#3400.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12440 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-11 00:50:06 +00:00
Albrecht Schlosser
ae983b74f2 Enhance howto-drag-and-drop example program.
Refer to discussion if fltk.general, thread "Drag and drop issue"
in August September 2017.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-08 15:02:04 +00:00
Albrecht Schlosser
7fc5bfc1ca Add tooltips to new draggable-group example program.
... as suggested by Greg.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12374 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-12 14:53:39 +00:00
Albrecht Schlosser
f643714879 Add draggable-group example program.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12372 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-05 16:44:49 +00:00
Albrecht Schlosser
e7af621409 Fix whitespace and comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12369 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-05 09:43:12 +00:00
Greg Ercolano
38f134c1ed Some compilers probably need string.h for strcmp()..
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12322 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-07-17 01:20:00 +00:00
Greg Ercolano
0173358351 Added new example program 'nativefilechooser-simple.cxx'
(Simpler than the application example)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12321 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-07-17 01:13:28 +00:00
Albrecht Schlosser
b7851fac8e Add missing #include in fltk-versions example program.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12312 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-07-12 21:49:19 +00:00
Manolo Gouy
7847c2d87a WIN32 HiDPI support: fix copy and paste of image data when rescaling is applied.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12297 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-07-07 14:31:40 +00:00
Albrecht Schlosser
21da3f3755 Flush output of examples/fltk-versions for Windows (MinGW).
MinGW wouldn't flush the output before closing the window.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12202 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-03-17 15:02:08 +00:00
Manolo Gouy
43935dffeb Add static void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) and pop_current() to set/unset the current drawing surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-12-07 15:09:52 +00:00
Albrecht Schlosser
6d4b93e9c7 Finally remove FLTK_ABI_VERSION preprocessor macro from code.
FLTK_ABI_VERSION has been renamed to FL_ABI_VERSION in FLTK 1.4.0.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12121 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-19 01:20:53 +00:00
Albrecht Schlosser
7659192447 Fix one compiler warning and one error on Windows 64-bit.
These warnings and errors were found using gcc 6.1 (64-bit) under Windows.

The error in examples/howto-add_fd-and-popen.cxx (-fpermissive) is due
to the wrong definition of Fl_FD_Handler under Windows 64-bit (FL_SOCKET!).

This should really be fixed in a better way in FLTK 1.4.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11871 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-11 12:41:17 +00:00
Manolo Gouy
22596d3f5f Make Fl_Gl_Window::pixels_per_unit() return a float (rather than int) value.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11794 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-06-22 07:45:53 +00:00
Manolo Gouy
dcb26fc188 Remove unneeded extern declaration.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-05-05 07:42:48 +00:00
Manolo Gouy
e6b4af2c47 Fix how to access clipboard content at program start.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11710 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-05-04 05:59:18 +00:00
Manolo Gouy
d47b431750 Fix potential memory leak under X11 when pasted image is not accepted by the receiving app.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11709 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-05-03 14:28:45 +00:00
Albrecht Schlosser
524ebcef0b Fix example programs after removal of some system #include's.
This adds missing headers that were previously included in other
FLTK header files.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11492 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-31 21:48:15 +00:00
Albrecht Schlosser
29a9e89b39 Remove FLTK_ABI_VERSION from all but *tree*.* and documentation.
Everything related to Fl_Tree and its test and demo programs has been
cleaned.

Documentation needs updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11428 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 02:55:14 +00:00
Manolo Gouy
2d5dbc3925 Add necessary #include directive
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11334 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-10 13:22:29 +00:00
Manolo Gouy
5866281d4f Set depth of image returned by Fl_Image_Surface::image() back to 3 on Mac OS X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11119 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-02 08:38:55 +00:00
Manolo Gouy
6f799cb648 Fix shapedwindow test program.
same commit as in 1.3 branch

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11107 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-01 14:24:24 +00:00
Manolo Gouy
3e8556195b Added required header and footer for new source files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10955 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-10 16:20:37 +00:00
Manolo Gouy
4bc4736eb7 Replaced call to Fl_Window::resize() by call to Fl_Widget::position() that is enough.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10952 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-08 09:39:42 +00:00
Manolo Gouy
22af09dae7 Mac OS: support for high resolution OpenGL windows.
Methods Fl::event_x_pixel() and Fl::event_y_pixel() committed at r.10941
are removed. Instead method Fl_Gl_Window::pixels_per_unit() is added.

The documentation explains in more detail how to write cross-platform
FLTK code supporting high resolution OpenGL windows on retina displays.

The examples/OpenGL3test.cxx app exercises Fl_Gl_Window::pixels_per_unit().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10945 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-02 09:59:37 +00:00
Manolo Gouy
597ac17bda Mac OS: added Fl::event_x_pixel() and Fl::event_y_pixel() that return the mouse event position
in pixel units that differ from FLTK units for OpenGL windows mapped to a retina display.
On non Mac OS platforms, these are synonyms of Fl::event_x() and Fl::event_y().
The example/OpenGL3test demo program is modified to call these new functions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10941 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-01 16:17:37 +00:00
Manolo Gouy
848744bcf0 Removed compilation warning.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10877 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-28 05:43:38 +00:00
Manolo Gouy
7e025aac22 Added support for OpenGL V3 and higher.
On the X11/MSWindows platforms, this requires external installation of the GLEW library.
This fixes STR#3198 and STR#3257.
Added two new examples programs.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10876 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-10-27 08:40:56 +00:00
Greg Ercolano
5534ce4c57 Small mod to enable highlighting in total cells.
This way someone hitting 'End' can see where the "cursor" is.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10835 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-08-19 21:38:17 +00:00
Albrecht Schlosser
e5d7f8367e Add "deprecated" warning to examples/fltk-versions.cxx.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10785 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-12 17:45:13 +00:00
Albrecht Schlosser
333b5268c3 Add FLTK version test program examples/fltk-versions.cxx.
This program can be used to verify that the FLTK runtime system
(ABI version) is binary compatible with the compiled and linked program.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10712 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-21 12:44:46 +00:00
Albrecht Schlosser
d24a6b2633 Move RGB image scaling algorithm methods in base class Fl_Image.
See also discussion in fltk.coredev of Sept 07, 2014 and later
with subject "Fixing the nearest-neighbour scaling".


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10377 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-14 11:53:51 +00:00
Manolo Gouy
f1b2c92fce STR#3093 continued: deleted the Fl_Shaped_Window class. Instead, added new member function Fl_Window::shape(Fl_Image*)
that gives a non-rectangular shape to a standard window. The benefit is that it works with Fl_Double_Window and Fl_Menu_Window as well.
It also works for free with Fl_Gl_Window on the X11 platform only.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-21 14:10:36 +00:00
Greg Ercolano
36b1ad056a Removed leftover item variable (now unused)
as noted by Albrecht on fltk.coredev today;
was giving warnings with Windows/MinGW builds.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10319 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-17 16:27:01 +00:00
Albrecht Schlosser
49e21120b6 Improve clipboard example program, fix compilation warnings.
Use show(argc,argv) to enable command line arguments and colors,
fix indentation, Windows compilation warnings, and change tab
selection color, which was too dark on my Win7 system (low
contrast with tab labels).

I also added #define TAB_COLOR to make changing the tab selection
colors easier, if needed.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10318 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-17 11:51:56 +00:00
Manolo Gouy
535fc72035 Fixed header/footer lines
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10262 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-02 09:12:32 +00:00
Ian MacArthur
9c583c5bbc Add Manolo's new shapedwindow demo to the Makefile
for the examples folder.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10258 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-08-28 09:13:27 +00:00
Manolo Gouy
8997131377 Added the Fl_Shaped_Window class to support windows of arbitrary shapes.
The new class is fully Doxygen-documented.
Added an example program (example/shapedwindow.cxx) that exercises the new class.
Modified all IDE-supporting files accordingly.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10255 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-08-27 11:55:57 +00:00
Manolo Gouy
90ba43b16c Reset file header and footer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10173 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-05-24 16:29:39 +00:00
Manolo Gouy
07dd8ba328 Added copy/paste from/to FLTK applications of graphical data.
Added Fl_Image_Surface class to draw into an Fl_Image object.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10159 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-05-23 16:47:21 +00:00
Greg Ercolano
6c90855ead Fix STR#3005; input field wasn't scrolling with table.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10087 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-27 06:47:04 +00:00
Greg Ercolano
abdc834705 o Added draw_item_content() to Fl_Tree_Item,
a volatile method that can be overridden by
  subclasses to take drawing control of tree item's content.

  This replaces the old "item_draw_callback()" technique
  added a few months ago as an ABI feature; turned out the
  new technique is a better way to go.

o The examples/tree-custom-draw-items.cxx demo adjusted
  accordingly.

o Added missing docs for some methods that had none,
  including label_[xywh]().

o Added related methods needed to implement this, including:
  	Fl_Tree_Item_Array::replace()
  	Fl_Tree_Item::replace()
	Fl_Tree::root(item)
        Fl_Tree::add() variations
	Fl_Tree_Item::drawbgcolor()/drawfgcolor()


o Carefully worked the FLTK_ABI_VERSION macros so as to be
  ABI compatible with 1.3.0.

o Verified 1.3.0 ABI compatibility with ABI Compliance Checker 1.99.8.5:
  http://ispras.linuxbase.org/index.php/ABI_compliance_checker




git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10071 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-20 21:23:24 +00:00
Greg Ercolano
1af599b4af Fixes errors:
warning: deprecated conversion from string constant to 'char*'



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10040 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-01 17:13:48 +00:00
Greg Ercolano
911ab3948a Added Fl_Tree sort example.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-12-16 10:26:44 +00:00
Greg Ercolano
88cea3c82d o Added Fl_Tree::item_draw_callback(), letting one define a custom draw function for Fl_Tree_Item's.
o Added examples/tree-custom-draw-items.cxx to demonstrate its use.
o Fixed small doc error for recent Fl_Tree::get_selected_items()



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10018 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-11-10 04:33:44 +00:00
Greg Ercolano
52d395ad81 Fix problem with Fl_Tree::select_only() invoking select callbacks
before all other items have first been deselected.

Also: added some related demo code to tree-simple to demonstrate
'reselect' callbacks, where a callback can be invoked when an item
that's selected already is 're-selected'.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10015 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-11-06 20:12:08 +00:00
Manolo Gouy
fb38d1cfda Replaced fopen() by fl_fopen() calls so the app works correctly under MSWindows with non ASCII filenames.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10005 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-10-22 09:09:53 +00:00