summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Input_.H2
-rw-r--r--FL/Fl_Preferences.H3
-rw-r--r--FL/Fl_Tree.H2
-rw-r--r--Makefile2
-rw-r--r--fltk.db43
-rw-r--r--fluid/ide_support.cxx4
-rw-r--r--ide/VisualC6/fltk.dsw3
-rw-r--r--ide/VisualC6/tree.dsp31
-rw-r--r--ide/Xcode3/FLTK.xcodeproj/project.pbxproj41
-rw-r--r--src/Fl_File_Chooser2.cxx2
-rw-r--r--src/Fl_Input_.cxx6
-rw-r--r--src/Fl_Preferences.cxx33
-rw-r--r--src/Fl_Text_Buffer.cxx2
-rw-r--r--src/Fl_Tree.cxx51
-rw-r--r--src/Fl_Tree_Item.cxx23
-rw-r--r--src/Fl_Tree_Prefs.cxx44
-rw-r--r--test/demo.cxx2
-rw-r--r--test/tree.cxx96
-rw-r--r--test/tree.fl107
-rw-r--r--test/tree.h3
20 files changed, 361 insertions, 139 deletions
diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H
index e93dd4c13..24bb641d4 100644
--- a/FL/Fl_Input_.H
+++ b/FL/Fl_Input_.H
@@ -151,7 +151,7 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
/** \internal Horizontal cursor position in pixels while movin up or down. */
static double up_down_pos;
- /** \internal Flag to remeber last cursor move. */
+ /** \internal Flag to remember last cursor move. */
static int was_up_down;
/* Convert a given text segment into the text that will be rendered on screen. */
diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H
index 5d48ceef9..49d66247e 100644
--- a/FL/Fl_Preferences.H
+++ b/FL/Fl_Preferences.H
@@ -156,7 +156,7 @@ public:
// char export( const char *filename, Type fileFormat );
// char import( const char *filename );
- char copyTo(class Fl_Tree*);
+ // char copyTo(class Fl_Tree*); // deprecated, use Fl_Tree::load(Fl_Preferences&)
/**
'Name' provides a simple method to create numerical or more complex
@@ -227,7 +227,6 @@ private:
public:
Node( const char *path );
~Node();
- char copyTo(class Fl_Tree*, class Fl_Tree_Item*);
// node methods
int write( FILE *f );
const char *name();
diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H
index c365d1ae8..be309c81f 100644
--- a/FL/Fl_Tree.H
+++ b/FL/Fl_Tree.H
@@ -688,6 +688,8 @@ public:
void selectmode(Fl_Tree_Select val) {
_prefs.selectmode(val);
}
+
+ void load(class Fl_Preferences&);
};
#endif /*FL_TREE_H*/
diff --git a/Makefile b/Makefile
index 95c52c7c2..f98f34c3b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
-# Copyright 1998-2009 by Bill Spitzak and others.
+# Copyright 1998-2010 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
diff --git a/fltk.db b/fltk.db
index 5383bb886..d896f4193 100644
--- a/fltk.db
+++ b/fltk.db
@@ -932,6 +932,7 @@ xcBuildFileID:9DD7A2B6D63D30C07781F446
refUUID:81A99CD2-985D-4B34-A385-DA2DF36B25C7
(filename):src/Fl_Paged_Device.cxx
+xcBuildFileID:299CB8A2848CB844BCEC7829
[./targets/libs/FCA55664-7065-436F-B7F2-7F7A397ED739/headers]
@@ -1290,12 +1291,6 @@ refUUID:A3D03C3D-FB0C-4D14-8AF8-96086624A44E
(filename):FL/Fl_Overlay_Window.H
xcCopyHeaderID:012DC7566408D3CBF672BE50
-[./targets/libs/FCA55664-7065-436F-B7F2-7F7A397ED739/headers/E4711E48-2B85-4DAB-BB3B-9DDCBD7C9160]
-
-refUUID:E2A26BE4-534B-4B50-AA6F-D28A7BF13F54
-(filename):FL/Fl_PSfile_Device.H
-xcCopyHeaderID:13B77D5A401B98BD18D3CCF8
-
[./targets/libs/FCA55664-7065-436F-B7F2-7F7A397ED739/headers/405F4A61-8DD8-423C-938C-FA24D4E451AD]
refUUID:A59BDACF-075D-4E17-8BE8-38E0E7A51003
@@ -1702,6 +1697,7 @@ xcCopyHeaderID:72843BB6450DBFB9A9F53490
refUUID:D7271ED9-045A-4F82-A493-3717A1B0D3AE
(filename):FL/Fl_Paged_Device.H
+xcCopyHeaderID:7582831EE62557F2D4668FA4
[./targets/libs/FCA55664-7065-436F-B7F2-7F7A397ED739/externals]
@@ -7629,12 +7625,6 @@ xcBuildConfigurationReleaseID:9E23AA974E99E89DC5E46D9F
[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/sources]
-[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/sources/2AA033DE-7570-445E-B0B8-B2695B27BC68]
-
-refUUID:5684BCF0-9061-4396-A4F5-1E8E633F716B
-(filename):test/tree.cxx
-xcBuildFileID:8B1319F9AB1424C1480A3133
-
[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/deps]
@@ -7644,6 +7634,12 @@ refUUID:FCA55664-7065-436F-B7F2-7F7A397ED739
xcProxyID:02A677752D704FC1308C2C01
xcDependencyID:89EEA83A9CD9747F05B1E6AA
+[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/deps/14C691AE-415D-4273-98F0-43175A8B54E6]
+
+refUUID:D70F995E-DA2E-46A4-9F93-90D4F6C7DE87
+xcProxyID:14AFCE90907C6F3225151910
+xcDependencyID:9519279882836E4B8EDEBE60
+
[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/libs]
@@ -7659,6 +7655,12 @@ xcCopyFrameworkID:F1C6FA1ABFEFA9DD53A7B8E8
[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/fl]
+[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/fl/93140A57-AA6D-46BC-972D-8ADAED12A7A8]
+
+refUUID:9ABC95B6-DEE6-4145-8EBA-A4D2CF1DC7CF
+(filename):test/tree.fl
+xcBuildFileID:16FC08C22B1B693EB00C15F5
+
[./targets/tests/9CE11918-3DC2-4650-B91B-28BABE55E182/externals]
@@ -8815,11 +8817,6 @@ xcFileID:D585CB55BDA143D343033352
pathAndName:FL/Fl_Overlay_Window.H
xcFileID:1FCDDD4E00F7CAA8193CAE04
-[./files/E2A26BE4-534B-4B50-AA6F-D28A7BF13F54]
-
-pathAndName:FL/Fl_PSfile_Device.H
-xcFileID:44C10E7FA85430F4E1D68B60
-
[./files/A59BDACF-075D-4E17-8BE8-38E0E7A51003]
pathAndName:FL/Fl_Pack.H
@@ -10290,11 +10287,6 @@ xcFileID:0DFF833B9E81E11FA3E3A85A
pathAndName:test/tiled_image.cxx
xcFileID:94D15578CD49CC75FE6617E4
-[./files/5684BCF0-9061-4396-A4F5-1E8E633F716B]
-
-pathAndName:test/tree.cxx
-xcFileID:ECCD42A2E7B2C6BF5B3DF410
-
[./files/7FB34E60-5136-423E-AD80-56CF9ABABE15]
pathAndName:test/utf8.cxx
@@ -10313,10 +10305,17 @@ xcFileID:48A8DC166D69EDC6F24AE678
[./files/81A99CD2-985D-4B34-A385-DA2DF36B25C7]
pathAndName:src/Fl_Paged_Device.cxx
+xcFileID:6C1C9A4F054C48CDD6A2DE44
[./files/D7271ED9-045A-4F82-A493-3717A1B0D3AE]
pathAndName:FL/Fl_Paged_Device.H
+xcFileID:4CABCBB89F9DD5CF57BB9779
+
+[./files/9ABC95B6-DEE6-4145-8EBA-A4D2CF1DC7CF]
+
+pathAndName:test/tree.fl
+xcFileID:D10B1EA053B5C8F02A636D93
[./ide]
diff --git a/fluid/ide_support.cxx b/fluid/ide_support.cxx
index 65a55e83b..ea3dd0d57 100644
--- a/fluid/ide_support.cxx
+++ b/fluid/ide_support.cxx
@@ -571,7 +571,6 @@ int create_new_database(const char *filename)
fltk_lib.add_header(files_db, "FL/Fl_Object.H");
fltk_lib.add_header(files_db, "FL/Fl_Output.H");
fltk_lib.add_header(files_db, "FL/Fl_Overlay_Window.H");
- fltk_lib.add_header(files_db, "FL/Fl_PSfile_Device.H");
fltk_lib.add_header(files_db, "FL/Fl_Pack.H");
fltk_lib.add_header(files_db, "FL/Fl_Paged_Device.H");
fltk_lib.add_header(files_db, "FL/Fl_Pixmap.H");
@@ -1324,8 +1323,9 @@ int create_new_database(const char *filename)
}
{ Fl_Target_Prefs db(tests_db.add_with_key("name", "tree"));
- db.add_source(files_db, "test/tree.cxx");
+ db.add_fl(files_db, "test/tree.fl");
db.add_lib(fltk_lib);
+ db.depends_on(fluid_app);
demo_db.depends_on(db);
}
diff --git a/ide/VisualC6/fltk.dsw b/ide/VisualC6/fltk.dsw
index 6b0a9b29e..c121e3284 100644
--- a/ide/VisualC6/fltk.dsw
+++ b/ide/VisualC6/fltk.dsw
@@ -1586,6 +1586,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name fltk
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name Fluid
+ End Project Dependency
}}}
###############################################################################
diff --git a/ide/VisualC6/tree.dsp b/ide/VisualC6/tree.dsp
index a5a867933..eab7cb60f 100644
--- a/ide/VisualC6/tree.dsp
+++ b/ide/VisualC6/tree.dsp
@@ -93,5 +93,36 @@ LINK32=link.exe
SOURCE=..\..\test\tree.cxx
# End Source File
+# Begin Source File
+
+SOURCE=..\..\test\tree.fl
+
+!IF "$(CFG)" == "tree - Win32 Release"
+
+# Begin Custom Build - Create .cxx and .h file with fluid
+InputPath=..\..\test\tree.fl
+
+"..\..\test\tree.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\..\test/
+ ..\fluid\fluid -c tree.fl
+ cd ..\ide\visualc
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "tree - Win32 Debug"
+
+# Begin Custom Build - Create .cxx and .h file with fluidd
+InputPath=..\..\test\tree.fl
+
+"..\..\test\tree.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\..\test/
+ ..\fluid\fluidd -c tree.fl
+ cd ..\ide\visualc
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
# End Target
# End Project
diff --git a/ide/Xcode3/FLTK.xcodeproj/project.pbxproj b/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
index 5458904dc..a82aa48dd 100644
--- a/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
+++ b/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
@@ -60,7 +60,6 @@
12E4293A141DD684369D6B8F /* fl_boxtype.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 9B54C6B8D801E899981FC5E6 /* fl_boxtype.cxx */; };
12EDA8498FE1A47E32A9428E /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = 5575DA9A654EB53C515F917A /* png.c */; };
1328D9EE314856BAB7A54D5A /* Fl_BMP_Image.H in Headers */ = {isa = PBXBuildFile; fileRef = B20D11CF3F871C99011F632E /* Fl_BMP_Image.H */; settings = {ATTRIBUTES = (Public, ); }; };
- 13B77D5A401B98BD18D3CCF8 /* Fl_PSfile_Device.H in Headers */ = {isa = PBXBuildFile; fileRef = 44C10E7FA85430F4E1D68B60 /* Fl_PSfile_Device.H */; settings = {ATTRIBUTES = (Public, ); }; };
13DE96EAB36238A478381098 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
1490AC534F76E26EF9280C6D /* Fl_add_idle.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 274CBEBF1D1BFD5C91605CBE /* Fl_add_idle.cxx */; };
1565219A0166F42F299C2C9E /* Fl_Browser_load.cxx in Sources */ = {isa = PBXBuildFile; fileRef = E46A3C4F955A94AE095FF726 /* Fl_Browser_load.cxx */; };
@@ -68,6 +67,7 @@
16C76FAEEC543074798FF0CB /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
16CA21C97F278A00B2558C3C /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = C4CF7DDC2EC8792157A3F43B /* pngread.c */; };
16F26F7D137CC7F7B57ECAC0 /* fltk_zlib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8880CD3FEF32388A24C1B94 /* fltk_zlib.framework */; };
+ 16FC08C22B1B693EB00C15F5 /* tree.fl in Sources */ = {isa = PBXBuildFile; fileRef = D10B1EA053B5C8F02A636D93 /* tree.fl */; };
17875FB347705D46D333E6EC /* fractals.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 598DD70F89D7731D61BBD8EF /* fractals.cxx */; };
180F08AFCDEE94081FDCD9AF /* Fl_Choice.H in Headers */ = {isa = PBXBuildFile; fileRef = C8AE10A8DDF53B8B27E3215A /* Fl_Choice.H */; settings = {ATTRIBUTES = (Public, ); }; };
185933E619D6C024C4B53D3B /* Fl_Value_Input.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 34CB383C3A4360C14B58562E /* Fl_Value_Input.cxx */; };
@@ -129,9 +129,9 @@
2800B0509A5D20FABE8F02DC /* fl_show_colormap.cxx in Sources */ = {isa = PBXBuildFile; fileRef = EB15CE98189A4C0A7A8A480F /* fl_show_colormap.cxx */; };
2832E97111DB41A4B13A4EFE /* keyboard_ui.fl in Sources */ = {isa = PBXBuildFile; fileRef = 7B084447C58E292798B27283 /* keyboard_ui.fl */; };
285B384349B0FC5FCE9C9FCE /* fl_open_uri.cxx in Sources */ = {isa = PBXBuildFile; fileRef = FAD24127A06F3F9F0EEB843A /* fl_open_uri.cxx */; };
- 28A5D2BB72720891608E7B82 /* Fl_Abstract_Printer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 5E009E15C14AA1D60827722D /* Fl_Abstract_Printer.cxx */; };
291FA24A9E91A2036BC718A2 /* Fl_Overlay_Window.cxx in Sources */ = {isa = PBXBuildFile; fileRef = D1C792936D427CC48581BFAE /* Fl_Overlay_Window.cxx */; };
29303C4480E0BBEB9E29EE7B /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = EBC0D2C965EDD6503B0CF519 /* vsnprintf.c */; };
+ 299CB8A2848CB844BCEC7829 /* Fl_Paged_Device.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 6C1C9A4F054C48CDD6A2DE44 /* Fl_Paged_Device.cxx */; };
29A99477531233BE9391CE66 /* Fl_Slider.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 5AF5119D08DFC92EA1032671 /* Fl_Slider.cxx */; };
29B01C1F3FF6C5B007DEEF45 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
29ED282EF51CBBB0CDEE76D6 /* Fl_Color_Chooser.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 058BCBC36ADE724A418F1C43 /* Fl_Color_Chooser.cxx */; };
@@ -368,6 +368,7 @@
74D195DEE3A33FA0C8C7A5BE /* Fl_Help_View.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 790419B5A0AD64D66F9B19E1 /* Fl_Help_View.cxx */; };
74D5FD7ED2AF3F51D8B2EEEB /* Fl_Slider.H in Headers */ = {isa = PBXBuildFile; fileRef = F2E5612A81A6E8D53ED91CAE /* Fl_Slider.H */; settings = {ATTRIBUTES = (Public, ); }; };
753A6417598E2D35C308632A /* valuators.fl in Sources */ = {isa = PBXBuildFile; fileRef = 590C56F672356072A5C86BC3 /* valuators.fl */; };
+ 7582831EE62557F2D4668FA4 /* Fl_Paged_Device.H in Headers */ = {isa = PBXBuildFile; fileRef = 4CABCBB89F9DD5CF57BB9779 /* Fl_Paged_Device.H */; settings = {ATTRIBUTES = (Public, ); }; };
761829645FD3BCA7EE9DE369 /* fltk_gl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = EA8E6EC230301E597B9D9AED /* fltk_gl.framework */; };
762325B25679668EB687A028 /* gl_overlay.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1F6E4CE3C0DF58D8F7B3A94A /* gl_overlay.cxx */; };
76BA5F2997A55DDFA04EFC98 /* ide_visualc.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 9C0598A21FEE02AA4F0E39C9 /* ide_visualc.cxx */; };
@@ -430,7 +431,6 @@
8A80E9D910324212101C3E76 /* fltk.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
8AB3C564389AED897174FFF2 /* Fl_Type.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0B800D01D215C41573FFE4DA /* Fl_Type.cxx */; };
8AC8FF5C9534F6E0664A352B /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
- 8B1319F9AB1424C1480A3133 /* tree.cxx in Sources */ = {isa = PBXBuildFile; fileRef = ECCD42A2E7B2C6BF5B3DF410 /* tree.cxx */; };
8BA3F05B96804E0FD9491049 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
8CC2898FB12015F247784420 /* jdcoefct.c in Sources */ = {isa = PBXBuildFile; fileRef = A715D265EAD3C5DA5628485C /* jdcoefct.c */; };
8CCF18F146F2012A0C1DC330 /* Fl_Return_Button.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D4184FF1C89B7CEE9FBD6 /* Fl_Return_Button.cxx */; };
@@ -568,7 +568,6 @@
BCFD2D2C8ED191EFB52166A4 /* fl_show_input.H in Headers */ = {isa = PBXBuildFile; fileRef = EFAE92A1C7CA90BC56E5A70A /* fl_show_input.H */; settings = {ATTRIBUTES = (Public, ); }; };
BD48B8B0B3DE04E72A17F60D /* jdmarker.c in Sources */ = {isa = PBXBuildFile; fileRef = BB37899B104B362F32F0F417 /* jdmarker.c */; };
BDB3A4C9B2AC519DC6A95D84 /* fl_dnd.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 2DD93178E8AFA850DAC293FC /* fl_dnd.cxx */; };
- BE079BCB8B1142B84067555A /* Fl_Abstract_Printer.H in Headers */ = {isa = PBXBuildFile; fileRef = F9AAAD5964050A3DC9E20879 /* Fl_Abstract_Printer.H */; settings = {ATTRIBUTES = (Public, ); }; };
BF212FE1FA8676E379DE4BC1 /* fltk_gl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = EA8E6EC230301E597B9D9AED /* fltk_gl.framework */; };
BF3BDB0B4DA065027B4771CA /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
BF7219C14C522420ED920D72 /* Fl_Simple_Counter.H in Headers */ = {isa = PBXBuildFile; fileRef = 9B57B581401BD8575BFAF2F1 /* Fl_Simple_Counter.H */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1785,6 +1784,13 @@
remoteGlobalIDString = A57FDE871C99A52BEEDEE68C;
remoteInfo = fltk;
};
+ 14AFCE90907C6F3225151910 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 4BF1A7FFEACF5F31B4127482 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = AE6BC0AEB24EBBBDBA4071E0;
+ remoteInfo = Fluid;
+ };
16BBABAD50B4194D5D76302F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4BF1A7FFEACF5F31B4127482 /* Project object */;
@@ -3947,7 +3953,6 @@
43D9A7CD936B1382F5EA23E1 /* about_panel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = about_panel.cxx; path = ../../fluid/about_panel.cxx; sourceTree = SOURCE_ROOT; };
44277061B27BFBE1FB22B79B /* menubar.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = menubar.cxx; path = ../../test/menubar.cxx; sourceTree = SOURCE_ROOT; };
44B6E71105CCEECB4D5E2DC8 /* ide_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ide_support.h; path = ../../fluid/ide_support.h; sourceTree = SOURCE_ROOT; };
- 44C10E7FA85430F4E1D68B60 /* Fl_PSfile_Device.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_PSfile_Device.H; path = ../../FL/Fl_PSfile_Device.H; sourceTree = SOURCE_ROOT; };
451D01896EFDD83277515630 /* glut.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = glut.H; path = ../../FL/glut.H; sourceTree = SOURCE_ROOT; };
4577F046D6D5D93D2553BFBC /* jdtrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jdtrans.c; path = ../../jpeg/jdtrans.c; sourceTree = SOURCE_ROOT; };
45B993D3FA0EED6037499D3A /* color_chooser.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = color_chooser.cxx; path = ../../test/color_chooser.cxx; sourceTree = SOURCE_ROOT; };
@@ -3965,6 +3970,7 @@
4C2979BC9629FABDCC0271BB /* jcmainct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jcmainct.c; path = ../../jpeg/jcmainct.c; sourceTree = SOURCE_ROOT; };
4C2EEE3E17025A63A0AEEF5F /* hello.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hello.cxx; path = ../../test/hello.cxx; sourceTree = SOURCE_ROOT; };
4C9AF6F2C1B78A67FFD177F9 /* gl2opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl2opengl.h; path = ../../FL/gl2opengl.h; sourceTree = SOURCE_ROOT; };
+ 4CABCBB89F9DD5CF57BB9779 /* Fl_Paged_Device.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Paged_Device.H; path = ../../FL/Fl_Paged_Device.H; sourceTree = SOURCE_ROOT; };
4CD4094D8712818EACF5C7C5 /* Fl_Progress.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Progress.H; path = ../../FL/Fl_Progress.H; sourceTree = SOURCE_ROOT; };
4CD5A5D2975A2CCB77EBAD43 /* jutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jutils.c; path = ../../jpeg/jutils.c; sourceTree = SOURCE_ROOT; };
4D124BD72F4E63D99837CE0C /* fl_encoding_latin1.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_encoding_latin1.cxx; path = ../../src/fl_encoding_latin1.cxx; sourceTree = SOURCE_ROOT; };
@@ -4005,7 +4011,6 @@
5CDA214AEABC15E3EF1BB172 /* Fl_Adjuster.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Adjuster.H; path = ../../FL/Fl_Adjuster.H; sourceTree = SOURCE_ROOT; };
5CE4CB9AEF9070A32A27696D /* fl_overlay_visual.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_overlay_visual.cxx; path = ../../src/fl_overlay_visual.cxx; sourceTree = SOURCE_ROOT; };
5D36F806A2C72F1894F0878E /* Fl_File_Icon.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_File_Icon.cxx; path = ../../src/Fl_File_Icon.cxx; sourceTree = SOURCE_ROOT; };
- 5E009E15C14AA1D60827722D /* Fl_Abstract_Printer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Abstract_Printer.cxx; path = ../../src/Fl_Abstract_Printer.cxx; sourceTree = SOURCE_ROOT; };
5E0EC227A972D2E4F34A2CEB /* Fl_Tree.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Tree.H; path = ../../FL/Fl_Tree.H; sourceTree = SOURCE_ROOT; };
5EF025FDE53B2276B6931CD5 /* clock.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = clock.cxx; path = ../../test/clock.cxx; sourceTree = SOURCE_ROOT; };
5F328DFEE7B768CF141C8E9E /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zutil.c; path = ../../zlib/zutil.c; sourceTree = SOURCE_ROOT; };
@@ -4033,6 +4038,7 @@
6B30F6EA5CA69E305D2B82EE /* is_right2left.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = is_right2left.c; path = ../../src/xutf8/is_right2left.c; sourceTree = SOURCE_ROOT; };
6BCDA929CD8600DE9AC516DD /* compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = compress.c; path = ../../zlib/compress.c; sourceTree = SOURCE_ROOT; };
6BDBE905BDAC3374782D6E81 /* input.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = input.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 6C1C9A4F054C48CDD6A2DE44 /* Fl_Paged_Device.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Paged_Device.cxx; path = ../../src/Fl_Paged_Device.cxx; sourceTree = SOURCE_ROOT; };
6C64353A3129BCCFAA667D86 /* boxtype.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = boxtype.cxx; path = ../../test/boxtype.cxx; sourceTree = SOURCE_ROOT; };
6CCA5064754A8314839CB37A /* freeglut_stroke_roman.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = freeglut_stroke_roman.cxx; path = ../../src/freeglut_stroke_roman.cxx; sourceTree = SOURCE_ROOT; };
6D999C03407EAEE9C4D3477A /* browser.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = browser.cxx; path = ../../test/browser.cxx; sourceTree = SOURCE_ROOT; };
@@ -4257,6 +4263,7 @@
D02CF2893ECCE831CD5D3176 /* Fl_Multi_Label.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Multi_Label.cxx; path = ../../src/Fl_Multi_Label.cxx; sourceTree = SOURCE_ROOT; };
D06E371A971A3BC1B399AD78 /* button.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = button.cxx; path = ../../test/button.cxx; sourceTree = SOURCE_ROOT; };
D0E376E93B4F22BE701D29E0 /* Fl_Roller.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Roller.cxx; path = ../../src/Fl_Roller.cxx; sourceTree = SOURCE_ROOT; };
+ D10B1EA053B5C8F02A636D93 /* tree.fl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.fluid; name = tree.fl; path = ../../test/tree.fl; sourceTree = SOURCE_ROOT; };
D1C792936D427CC48581BFAE /* Fl_Overlay_Window.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Overlay_Window.cxx; path = ../../src/Fl_Overlay_Window.cxx; sourceTree = SOURCE_ROOT; };
D2DE1079C826533A91053A9C /* Fl_XBM_Image.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_XBM_Image.H; path = ../../FL/Fl_XBM_Image.H; sourceTree = SOURCE_ROOT; };
D33C668435685F7CCB359EE2 /* pngrio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngrio.c; path = ../../png/pngrio.c; sourceTree = SOURCE_ROOT; };
@@ -4336,7 +4343,6 @@
EC2BAEE540612218DC9EEC75 /* Fl_Scroll.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Scroll.H; path = ../../FL/Fl_Scroll.H; sourceTree = SOURCE_ROOT; };
EC57889382FB898FD3EF2580 /* Fl_Gl_Window.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_Gl_Window.cxx; path = ../../src/Fl_Gl_Window.cxx; sourceTree = SOURCE_ROOT; };
EC5862E1FC79542DC55D8462 /* colbrowser.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = colbrowser.cxx; path = ../../test/colbrowser.cxx; sourceTree = SOURCE_ROOT; };
- ECCD42A2E7B2C6BF5B3DF410 /* tree.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tree.cxx; path = ../../test/tree.cxx; sourceTree = SOURCE_ROOT; };
ECFF712363202EC351A51E53 /* Fl_PNM_Image.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fl_PNM_Image.cxx; path = ../../src/Fl_PNM_Image.cxx; sourceTree = SOURCE_ROOT; };
EDCB878D48197F6AE1C99614 /* jidctred.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jidctred.c; path = ../../jpeg/jidctred.c; sourceTree = SOURCE_ROOT; };
EDE6CE6B09D31AC0AAC9FF56 /* fullscreen.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fullscreen.cxx; path = ../../test/fullscreen.cxx; sourceTree = SOURCE_ROOT; };
@@ -4366,7 +4372,6 @@
F8BAA8B283D4CF4D904B6486 /* Fl_Valuator.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Valuator.H; path = ../../FL/Fl_Valuator.H; sourceTree = SOURCE_ROOT; };
F91DEF40DC3592BE52CAB001 /* Fl_Native_File_Chooser.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Native_File_Chooser.H; path = ../../FL/Fl_Native_File_Chooser.H; sourceTree = SOURCE_ROOT; };
F98FE04C081FB5B1161C546C /* Fl_Window.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Window.H; path = ../../FL/Fl_Window.H; sourceTree = SOURCE_ROOT; };
- F9AAAD5964050A3DC9E20879 /* Fl_Abstract_Printer.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Abstract_Printer.H; path = ../../FL/Fl_Abstract_Printer.H; sourceTree = SOURCE_ROOT; };
FA2F70BA8FF4E7F4B7B36971 /* fl_file_dir.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_file_dir.cxx; path = ../../src/fl_file_dir.cxx; sourceTree = SOURCE_ROOT; };
FAA6BA6E4DC1AF28F5FC8466 /* Fl_Tile.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Tile.H; path = ../../FL/Fl_Tile.H; sourceTree = SOURCE_ROOT; };
FAD24127A06F3F9F0EEB843A /* fl_open_uri.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_open_uri.cxx; path = ../../src/fl_open_uri.cxx; sourceTree = SOURCE_ROOT; };
@@ -5154,7 +5159,6 @@
children = (
B04F6E032ADAF0A16A860A2E /* Headers */,
F4EFF27D730BED51EF0EAA8D /* Fl.cxx */,
- 5E009E15C14AA1D60827722D /* Fl_Abstract_Printer.cxx */,
19C5DB6F3DD5011DAE6F79AB /* Fl_Adjuster.cxx */,
3F000DD5F091F66BC42822E3 /* Fl_Bitmap.cxx */,
C3F048573FAEABD2D27401D4 /* Fl_Box.cxx */,
@@ -5303,6 +5307,7 @@
FB7A9EFB3C7CDAE324E9544F /* case.c */,
6B30F6EA5CA69E305D2B82EE /* is_right2left.c */,
5AE1F936F1C186E18C1B9C28 /* is_spacing.c */,
+ 6C1C9A4F054C48CDD6A2DE44 /* Fl_Paged_Device.cxx */,
E05754DEC1813B6BA6DC1FC8 /* AudioToolbox.framework */,
);
name = fltk;
@@ -5420,7 +5425,7 @@
2DD062AF5E08E6EEAE97E188 /* tree */ = {
isa = PBXGroup;
children = (
- ECCD42A2E7B2C6BF5B3DF410 /* tree.cxx */,
+ D10B1EA053B5C8F02A636D93 /* tree.fl */,
);
name = tree;
sourceTree = "<group>";
@@ -5904,7 +5909,6 @@
children = (
84CE79448708855561FEE498 /* Enumerations.H */,
C359E5D5187606DD69C7938B /* Fl.H */,
- F9AAAD5964050A3DC9E20879 /* Fl_Abstract_Printer.H */,
5CDA214AEABC15E3EF1BB172 /* Fl_Adjuster.H */,
FE90AA3BB40510FA45E0C27B /* Fl_Bitmap.H */,
390863A4D5D1B4C7C9B58679 /* Fl_Box.H */,
@@ -5962,7 +5966,6 @@
EE2FB1F7B99BE408E1B4DFB7 /* Fl_Object.H */,
D585CB55BDA143D343033352 /* Fl_Output.H */,
1FCDDD4E00F7CAA8193CAE04 /* Fl_Overlay_Window.H */,
- 44C10E7FA85430F4E1D68B60 /* Fl_PSfile_Device.H */,
52C3B1D0A473BDC01D497917 /* Fl_Pack.H */,
B8455C1BD96FF6FB3C197C34 /* Fl_Pixmap.H */,
A8F89055CABBCFECCC4CC940 /* Fl_Plugin.H */,
@@ -6030,6 +6033,7 @@
D5CE28437ABB8513BE08AC77 /* names.h */,
62281FC096BA407C4F1E6824 /* win32.H */,
83CED42A779FA76E98D37CA8 /* x.H */,
+ 4CABCBB89F9DD5CF57BB9779 /* Fl_Paged_Device.H */,
);
name = Headers;
sourceTree = "<group>";
@@ -6422,7 +6426,6 @@
files = (
05D71028D71BB089B3157E35 /* Enumerations.H in Headers */,
0231212CBF1A26721E3F20FE /* Fl.H in Headers */,
- BE079BCB8B1142B84067555A /* Fl_Abstract_Printer.H in Headers */,
1EE443C865A80CACB57E4815 /* Fl_Adjuster.H in Headers */,
424ADD12193823093AF1FBDF /* Fl_Bitmap.H in Headers */,
E02DABD44EE5FDAC20F3F676 /* Fl_Box.H in Headers */,
@@ -6480,7 +6483,6 @@
A9E5239AB84083A21F3F490B /* Fl_Object.H in Headers */,
62CFB49620B17B8938A1063F /* Fl_Output.H in Headers */,
012DC7566408D3CBF672BE50 /* Fl_Overlay_Window.H in Headers */,
- 13B77D5A401B98BD18D3CCF8 /* Fl_PSfile_Device.H in Headers */,
3D282039331A6ECDFED5255E /* Fl_Pack.H in Headers */,
B9134F6A1769B94761981AEA /* Fl_Pixmap.H in Headers */,
93CC0E443DAAB241C7EEE4B7 /* Fl_Plugin.H in Headers */,
@@ -6548,6 +6550,7 @@
D8C2D8F3053EEF229EEF66FB /* names.h in Headers */,
43EF9194502AFF8F5EE968EE /* win32.H in Headers */,
72843BB6450DBFB9A9F53490 /* x.H in Headers */,
+ 7582831EE62557F2D4668FA4 /* Fl_Paged_Device.H in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -8208,6 +8211,7 @@
);
dependencies = (
89EEA83A9CD9747F05B1E6AA /* PBXTargetDependency */,
+ 9519279882836E4B8EDEBE60 /* PBXTargetDependency */,
);
name = tree;
productName = tree;
@@ -8991,7 +8995,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 8B1319F9AB1424C1480A3133 /* tree.cxx in Sources */,
+ 16FC08C22B1B693EB00C15F5 /* tree.fl in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -9094,7 +9098,6 @@
buildActionMask = 2147483647;
files = (
ED83B85BA678C8C9B5E91535 /* Fl.cxx in Sources */,
- 28A5D2BB72720891608E7B82 /* Fl_Abstract_Printer.cxx in Sources */,
B371C5FF1106E69056784D6C /* Fl_Adjuster.cxx in Sources */,
274F92CF30A586E0F8E21530 /* Fl_Bitmap.cxx in Sources */,
40E66CBA06083998669F80CE /* Fl_Box.cxx in Sources */,
@@ -9243,6 +9246,7 @@
EF0B77D0D7EF375C1CBDC390 /* case.c in Sources */,
CE14EC6653D4EF4779992758 /* is_right2left.c in Sources */,
9DD7A2B6D63D30C07781F446 /* is_spacing.c in Sources */,
+ 299CB8A2848CB844BCEC7829 /* Fl_Paged_Device.cxx in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -10253,6 +10257,11 @@
target = 5C2FE9F5E71E04EA903248FA /* input */;
targetProxy = 3B38ABA4483E58B2891D08CB /* PBXContainerItemProxy */;
};
+ 9519279882836E4B8EDEBE60 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = AE6BC0AEB24EBBBDBA4071E0 /* Fluid */;
+ targetProxy = 14AFCE90907C6F3225151910 /* PBXContainerItemProxy */;
+ };
951CA1D37E7F30B53E37B095 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A57FDE871C99A52BEEDEE68C /* fltk */;
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index f7e095e86..33b7e3f2e 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1031,6 +1031,8 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s)
if (!allfiles) showChoice->add(all_files_label);
showChoice->add(custom_filter_label);
+
+ // TODO: add a menu item to switch hidden files on and off
showChoice->value(0);
showChoiceCB();
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 67b9fe709..d39fe62d6 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -722,12 +722,12 @@ static void undobuffersize(int n) {
<tt>when() & FL_WHEN_CHANGED</tt> and there is a change.
Set \p b and \p e equal to not delete anything.
- Set insert to \c NULL to not insert anything.
+ Set \p text to \c NULL to not insert anything.
- \p ilen must be zero or strlen(insert), this
+ \p ilen can be zero or <tt>strlen(text)</tt>, which
saves a tiny bit of time if you happen to already know the
length of the insertion, or can be used to insert a portion of a
- string or a string containing <tt>nul</tt>'s.
+ string.
\p b and \p e are clamped to the
<tt>0..size()</tt> range, so it is safe to pass any values.
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 466a4f5d6..7a5a72b36 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -380,17 +380,6 @@ Fl_Preferences::~Fl_Preferences()
/**
- Copy the database hierarchy to an Fl_Tree browser from this node down.
- */
-char Fl_Preferences::copyTo(Fl_Tree *tree)
-{
- if (!tree->root())
- tree->add(name());
- return node->copyTo(tree, tree->root());
-}
-
-
-/**
Returns the number of groups that are contained within a group.
\return 0 for no groups at all
@@ -1762,28 +1751,6 @@ void Fl_Preferences::Node::deleteIndex() {
indexed_ = 0;
}
-char Fl_Preferences::Node::copyTo(Fl_Tree *tree, Fl_Tree_Item *ti)
-{
- ti->label(name());
- ti->user_data(this);
- Node *nd = child_;
- for ( ; nd; nd = nd->next_) {
- Fl_Tree_Item *tic = tree->insert(ti, 0, 0);
- nd->copyTo(tree, tic);
- tic->close();
- }
- int i, n = nEntry_;
- for (i=0; i<n; i++) {
- char buf[80];
- const char *name = entry_[i].name;
- const char *value = entry_[i].value;
- fl_snprintf(buf, 80, "%s: %s", name, value);
- tree->add(ti, buf);
- }
- return 0;
-}
-
-
/**
* \brief Create a plugin.
*
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index 5c87340b6..74e04688a 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -1909,7 +1909,7 @@ static void addPadding(char *string, int startIndent, int toIndent,
if (useTabs) {
while (indent < toIndent) {
- static char t = '\t';
+ //static char t = '\t';
len = Fl_Text_Buffer::character_width("\t", indent, tabDist);
if (len > 1 && indent + len <= toIndent) {
*outPtr++ = '\t';
diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx
index 25d509c97..54b56ee63 100644
--- a/src/Fl_Tree.cxx
+++ b/src/Fl_Tree.cxx
@@ -7,6 +7,7 @@
#include <string.h>
#include <FL/Fl_Tree.H>
+#include <FL/Fl_Preferences.H>
#define SCROLL_W 15
@@ -426,6 +427,56 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) {
return(changed);
}
+/**
+ * Read a preferences database into the tree widget.
+ * A preferences database is a hierarchical collection of data which can be
+ * directly loaded into the tree view for inspection.
+ * \param[in] prefs the Fl_Preferences database
+ */
+void Fl_Tree::load(Fl_Preferences &prefs)
+{
+ int i, j, n, pn = strlen(prefs.path());
+ char *p;
+ const char *path = prefs.path();
+ if (strcmp(path, ".")==0)
+ path += 1; // root path is empty
+ else
+ path += 2; // child path starts with "./"
+ n = prefs.groups();
+ for (i=0; i<n; i++) {
+ Fl_Preferences prefsChild(prefs, i);
+ add(prefsChild.path()+2); // children always start with "./"
+ load(prefsChild);
+ }
+ n = prefs.entries();
+ for (i=0; i<n; i++) {
+ // We must remove all fwd slashes in the key and value strings. Replace with backslash.
+ char *key = strdup(prefs.entry(i));
+ int kn = strlen(key);
+ for (j=0; j<kn; j++) {
+ if (key[j]=='/') key[j]='\\';
+ }
+ char *val; prefs.get(key, val, "");
+ int vn = strlen(val);
+ for (j=0; j<vn; j++) {
+ if (val[j]=='/') val[j]='\\';
+ }
+ if (vn<40) {
+ int sze = pn + strlen(key) + vn;
+ p = (char*)malloc(sze+5);
+ sprintf(p, "%s/%s = %s", path, key, val);
+ } else {
+ int sze = pn + strlen(key) + 40;
+ p = (char*)malloc(sze+5);
+ sprintf(p, "%s/%s = %.40s...", path, key, val);
+ }
+ add(p[0]=='/'?p+1:p);
+ free(p);
+ free(val);
+ free(key);
+ }
+}
+
//
// End of "$Id$".
//
diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx
index 18a1cfac4..24f33cd2c 100644
--- a/src/Fl_Tree_Item.cxx
+++ b/src/Fl_Tree_Item.cxx
@@ -481,6 +481,11 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
int H = _labelsize;
if(usericon() && H < usericon()->h()) H = usericon()->h();
H += prefs.linespacing() + fl_descent();
+ // adjust horizontally if we draw no connecting lines
+ if ( is_root() && prefs.connectorstyle() == FL_TREE_CONNECTOR_NONE ) {
+ X -= prefs.openicon()->w();
+ W += prefs.openicon()->w();
+ }
// Colors, fonts
Fl_Color fg = _selected ? prefs.bgcolor() : _labelfgcolor;
Fl_Color bg = _selected ? prefs.selectcolor() : _labelbgcolor;
@@ -497,9 +502,9 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
int textw=0, texth=0;
fl_measure(_label, textw, texth, 0);
int textycenter = Y+(H/2);
- int &icon_x = _collapse_xywh[0] = X-1;
- int &icon_y = _collapse_xywh[1] = textycenter - (prefs.openicon()->h()/2);
int &icon_w = _collapse_xywh[2] = prefs.openicon()->w();
+ int &icon_x = _collapse_xywh[0] = X + (icon_w + prefs.connectorwidth())/2 - 3;
+ int &icon_y = _collapse_xywh[1] = textycenter - (prefs.openicon()->h()/2);
_collapse_xywh[3] = prefs.openicon()->h();
// Horizontal connector values
int hstartx = X+icon_w/2-1;
@@ -514,7 +519,11 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
// Draw connectors
if ( prefs.connectorstyle() != FL_TREE_CONNECTOR_NONE ) {
// Horiz connector between center of icon and text
- draw_horizontal_connector(hstartx, hendx, textycenter, prefs);
+ // if this is root, the connector should not dangle in thin air on the left
+ if (is_root())
+ draw_horizontal_connector(hcenterx, hendx, textycenter, prefs);
+ else
+ draw_horizontal_connector(hstartx, hendx, textycenter, prefs);
if ( has_children() && is_open() ) {
// Small vertical line down to children
draw_vertical_connector(hcenterx, textycenter, Y+H, prefs);
@@ -538,9 +547,11 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
}
}
// Background for this item
- int &bx = _label_xywh[0] = X+(icon_w/2-1+prefs.connectorwidth());
+ int cw1 = icon_w+prefs.connectorwidth()/2, cw2 = prefs.connectorwidth();
+ int cwidth = cw1>cw2 ? cw1 : cw2;
+ int &bx = _label_xywh[0] = X+(icon_w/2-1+cwidth);
int &by = _label_xywh[1] = Y;
- int &bw = _label_xywh[2] = W-(icon_w/2-1+prefs.connectorwidth());
+ int &bw = _label_xywh[2] = W-(icon_w/2-1+cwidth);
int &bh = _label_xywh[3] = H;
// Draw bg only if different from tree's bg
if ( bg != tree->color() || is_selected() ) {
@@ -554,7 +565,7 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Widget *tree,
}
}
// Draw user icon (if any)
- int useroff = (icon_w/2-1+prefs.connectorwidth());
+ int useroff = (icon_w/2-1+cwidth);
if ( usericon() ) {
// Item has user icon? Use it
useroff += prefs.usericonmarginleft();
diff --git a/src/Fl_Tree_Prefs.cxx b/src/Fl_Tree_Prefs.cxx
index 4adee203d..04afda404 100644
--- a/src/Fl_Tree_Prefs.cxx
+++ b/src/Fl_Tree_Prefs.cxx
@@ -34,6 +34,22 @@
// These can be replaced via prefs.openicon()/closeicon()
//
static const char *L_open_xpm[] = {
+#ifdef __APPLE__
+ "11 11 2 1",
+ ". c None",
+ "@ c #000000",
+ "...@.......",
+ "...@@......",
+ "...@@@.....",
+ "...@@@@....",
+ "...@@@@@...",
+ "...@@@@@@..",
+ "...@@@@@...",
+ "...@@@@....",
+ "...@@@.....",
+ "...@@......",
+ "...@......."
+#else
"11 11 3 1",
". c #fefefe",
"# c #444444",
@@ -48,10 +64,28 @@ static const char *L_open_xpm[] = {
"#....@....#",
"#.........#",
"#.........#",
- "###########"};
+ "###########"
+#endif
+};
static Fl_Pixmap L_openpixmap(L_open_xpm);
static const char *L_close_xpm[] = {
+#ifdef __APPLE__
+ "11 11 2 1",
+ ". c None",
+ "@ c #000000",
+ "...........",
+ "...........",
+ "...........",
+ "...........",
+ "...........",
+ "@@@@@@@@@@@",
+ ".@@@@@@@@@.",
+ "..@@@@@@@..",
+ "...@@@@@...",
+ "....@@@....",
+ ".....@....."
+#else
"11 11 3 1",
". c #fefefe",
"# c #444444",
@@ -66,7 +100,9 @@ static const char *L_close_xpm[] = {
"#.........#",
"#.........#",
"#.........#",
- "###########"};
+ "###########"
+#endif
+};
static Fl_Pixmap L_closepixmap(L_close_xpm);
/// Sets the default icon to be used as the 'open' icon
@@ -105,7 +141,11 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() {
_selectcolor = FL_DARK_BLUE;
_inactivecolor = FL_GRAY;
_connectorcolor = Fl_Color(43);
+#ifdef __APPLE__
+ _connectorstyle = FL_TREE_CONNECTOR_NONE;
+#else
_connectorstyle = FL_TREE_CONNECTOR_DOTTED;
+#endif
_openimage = &L_openpixmap;
_closeimage = &L_closepixmap;
_userimage = 0;
diff --git a/test/demo.cxx b/test/demo.cxx
index 221f47eb8..cca6243de 100644
--- a/test/demo.cxx
+++ b/test/demo.cxx
@@ -92,7 +92,7 @@ const char *default_menu[] = {
"@e:Block\\nAttack!:blocks\n",
"@e:Checkers:checkers\n",
"@e:Sudoku:sudoku\n",
- "@e:Print\nsupport:device\n",
+ "@e:Print\\nsupport:device\n",
"\n",
"@main:Other\\nTests:@o\n",
"@o:Color Choosers:color_chooser\n",
diff --git a/test/tree.cxx b/test/tree.cxx
index 580794165..fbecc7be1 100644
--- a/test/tree.cxx
+++ b/test/tree.cxx
@@ -218,6 +218,23 @@ Fl_Choice *collapseicons_chooser=(Fl_Choice *)0;
static void cb_collapseicons_chooser(Fl_Choice*, void*) {
static const char *L_open_xpm[] = {
+#ifdef __APPLE__
+ "11 11 3 1",
+ ". c #fefefe",
+ "# c #444444",
+ "@ c #000000",
+ "###########",
+ "#.........#",
+ "#.........#",
+ "#....@....#",
+ "#....@....#",
+ "#..@@@@@..#",
+ "#....@....#",
+ "#....@....#",
+ "#.........#",
+ "#.........#",
+ "###########"
+#else
"11 11 2 1",
". c None",
"@ c #000000",
@@ -231,10 +248,29 @@ static void cb_collapseicons_chooser(Fl_Choice*, void*) {
"...@@@@....",
"...@@@.....",
"...@@......",
- "...@......."};
+ "...@......."
+#endif
+ };
static Fl_Pixmap L_openpixmap(L_open_xpm);
static const char *L_close_xpm[] = {
+#ifdef __APPLE__
+ "11 11 3 1",
+ ". c #fefefe",
+ "# c #444444",
+ "@ c #000000",
+ "###########",
+ "#.........#",
+ "#.........#",
+ "#.........#",
+ "#.........#",
+ "#..@@@@@..#",
+ "#.........#",
+ "#.........#",
+ "#.........#",
+ "#.........#",
+ "###########"
+#else
"11 11 2 1",
". c None",
"@ c #000000",
@@ -248,7 +284,9 @@ static const char *L_close_xpm[] = {
"..@@@@@@@..",
"...@@@@@...",
"....@@@....",
- ".....@....."};
+ ".....@....."
+#endif
+ };
static Fl_Pixmap L_closepixmap(L_close_xpm);
switch ( collapseicons_chooser->value() ) {
@@ -270,7 +308,7 @@ switch ( collapseicons_chooser->value() ) {
Fl_Menu_Item menu_collapseicons_chooser[] = {
{"Normal", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
- {"Arrow", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"Custom", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
{"Off", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
{0,0,0,0,0,0,0,0,0}
};
@@ -519,6 +557,18 @@ static void cb_clearall_button(Fl_Button*, void*) {
tree->redraw();
}
+Fl_Button *loaddb_button=(Fl_Button *)0;
+
+static void cb_loaddb_button(Fl_Button*, void*) {
+ const char *filename = fl_file_chooser("Select a Preferences style Databse", "Preferences(*.prefs)", 0L);
+if (filename) {
+ tree->clear();
+ Fl_Preferences prefs(filename, 0L, 0L);
+ tree->load(prefs);
+ tree->redraw();
+};
+}
+
int main(int argc, char **argv) {
{ window = new Fl_Double_Window(580, 695, "tree");
{ tree = new Fl_Tree(15, 15, 550, 390);
@@ -538,7 +588,6 @@ int main(int argc, char **argv) {
margintop_slider->tooltip("Changes the top margin for the tree widget");
margintop_slider->type(1);
margintop_slider->labelsize(12);
- margintop_slider->step(0.01);
margintop_slider->textsize(12);
margintop_slider->callback((Fl_Callback*)cb_margintop_slider, (void*)(tree));
margintop_slider->align(Fl_Align(FL_ALIGN_LEFT));
@@ -551,7 +600,6 @@ int main(int argc, char **argv) {
marginleft_slider->tooltip("Changes the left margin for the tree widget");
marginleft_slider->type(1);
marginleft_slider->labelsize(12);
- marginleft_slider->step(0.01);
marginleft_slider->textsize(12);
marginleft_slider->callback((Fl_Callback*)cb_marginleft_slider, (void*)(tree));
marginleft_slider->align(Fl_Align(FL_ALIGN_LEFT));
@@ -564,7 +612,6 @@ int main(int argc, char **argv) {
openchild_marginbottom_slider->tooltip("Changes the vertical space below an open child tree");
openchild_marginbottom_slider->type(1);
openchild_marginbottom_slider->labelsize(12);
- openchild_marginbottom_slider->step(0.01);
openchild_marginbottom_slider->textsize(12);
openchild_marginbottom_slider->callback((Fl_Callback*)cb_openchild_marginbottom_slider, (void*)(tree));
openchild_marginbottom_slider->align(Fl_Align(FL_ALIGN_LEFT));
@@ -578,7 +625,6 @@ int main(int argc, char **argv) {
d");
labelsize_slider->type(1);
labelsize_slider->labelsize(12);
- labelsize_slider->step(0.01);
labelsize_slider->textsize(12);
labelsize_slider->callback((Fl_Callback*)cb_labelsize_slider, (void*)(tree));
labelsize_slider->align(Fl_Align(FL_ALIGN_LEFT));
@@ -591,29 +637,28 @@ d");
connectorwidth_slider->tooltip("Tests Fl_Tree::connectorwidth()");
connectorwidth_slider->type(1);
connectorwidth_slider->labelsize(12);
- connectorwidth_slider->step(0.01);
connectorwidth_slider->textsize(12);
connectorwidth_slider->callback((Fl_Callback*)cb_connectorwidth_slider, (void*)(tree));
connectorwidth_slider->align(Fl_Align(FL_ALIGN_LEFT));
o->value(tree->connectorwidth());
- o->range(10.0, 100.0);
+ o->range(1.0, 100.0);
o->step(1.0);
o->color(46); o->selection_color(FL_RED);
} // Fl_Value_Slider* connectorwidth_slider
- { usericon_radio = new Fl_Check_Button(145, 520, 130, 16, "Enable user icons?");
+ { usericon_radio = new Fl_Check_Button(145, 525, 130, 16, "Enable user icons?");
usericon_radio->tooltip("Tests Fl_Tree_Item::usericon()");
usericon_radio->down_box(FL_DOWN_BOX);
usericon_radio->labelsize(11);
usericon_radio->callback((Fl_Callback*)cb_usericon_radio, (void*)(tree));
} // Fl_Check_Button* usericon_radio
- { showroot_radio = new Fl_Check_Button(145, 539, 130, 16, "Show root?");
+ { showroot_radio = new Fl_Check_Button(145, 544, 130, 16, "Show root?");
showroot_radio->tooltip("Tests Fl_Tree_Item::usericon()");
showroot_radio->down_box(FL_DOWN_BOX);
showroot_radio->labelsize(11);
showroot_radio->callback((Fl_Callback*)cb_showroot_radio, (void*)(tree));
int onoff = tree->showroot(); showroot_radio->value(onoff);
} // Fl_Check_Button* showroot_radio
- { collapseicons_chooser = new Fl_Choice(145, 564, 110, 16, "Collapse icons");
+ { collapseicons_chooser = new Fl_Choice(145, 572, 110, 16, "Collapse icons");
collapseicons_chooser->tooltip("Tests Fl_Tree::openicon() and Fl_Tree::closeicon()");
collapseicons_chooser->down_box(FL_BORDER_BOX);
collapseicons_chooser->labelsize(11);
@@ -621,16 +666,16 @@ d");
collapseicons_chooser->callback((Fl_Callback*)cb_collapseicons_chooser);
collapseicons_chooser->menu(menu_collapseicons_chooser);
} // Fl_Choice* collapseicons_chooser
- { connectorstyle_chooser = new Fl_Choice(145, 584, 110, 16, "Line style");
+ { connectorstyle_chooser = new Fl_Choice(145, 592, 110, 16, "Line style");
connectorstyle_chooser->tooltip("Tests connectorstyle() bit flags");
connectorstyle_chooser->down_box(FL_BORDER_BOX);
connectorstyle_chooser->labelsize(11);
connectorstyle_chooser->textsize(11);
connectorstyle_chooser->callback((Fl_Callback*)cb_connectorstyle_chooser);
connectorstyle_chooser->menu(menu_connectorstyle_chooser);
- connectorstyle_chooser->value(1); // tree's default is 'dotted'
+ switch (tree->connectorstyle()) { case FL_TREE_CONNECTOR_NONE: connectorstyle_chooser->value(0); break; case FL_TREE_CONNECTOR_DOTTED: connectorstyle_chooser->value(1); break; case FL_TREE_CONNECTOR_SOLID: connectorstyle_chooser->value(2); break; }
} // Fl_Choice* connectorstyle_chooser
- { labelcolor_chooser = new Fl_Choice(145, 604, 110, 16, "Item Text Color");
+ { labelcolor_chooser = new Fl_Choice(145, 612, 110, 16, "Item Text Color");
labelcolor_chooser->tooltip("Changes the label color for the selected items\nIf no items selected, all are\
changed");
labelcolor_chooser->down_box(FL_BORDER_BOX);
@@ -639,7 +684,7 @@ d");
labelcolor_chooser->callback((Fl_Callback*)cb_labelcolor_chooser);
labelcolor_chooser->menu(menu_labelcolor_chooser);
} // Fl_Choice* labelcolor_chooser
- { selectmode_chooser = new Fl_Choice(145, 624, 110, 16, "Selection Mode");
+ { selectmode_chooser = new Fl_Choice(145, 632, 110, 16, "Selection Mode");
selectmode_chooser->tooltip("Sets how Fl_Tree handles mouse selection of tree items");
selectmode_chooser->down_box(FL_BORDER_BOX);
selectmode_chooser->labelsize(11);
@@ -649,7 +694,7 @@ d");
selectmode_chooser->value(1);
cb_selectmode_chooser(selectmode_chooser, (void*)0);
} // Fl_Choice* selectmode_chooser
- { whenmode_chooser = new Fl_Choice(145, 644, 110, 16, "When");
+ { whenmode_chooser = new Fl_Choice(145, 652, 110, 16, "When");
whenmode_chooser->tooltip("Sets when() the tree\'s callback is invoked");
whenmode_chooser->down_box(FL_BORDER_BOX);
whenmode_chooser->labelsize(11);
@@ -688,37 +733,42 @@ d");
bbbchild02select_toggle->labelsize(11);
bbbchild02select_toggle->callback((Fl_Callback*)cb_bbbchild02select_toggle);
} // Fl_Light_Button* bbbchild02select_toggle
- { deactivate_toggle = new Fl_Light_Button(280, 625, 90, 16, " Deactivate");
+ { deactivate_toggle = new Fl_Light_Button(280, 633, 90, 16, " Deactivate");
deactivate_toggle->tooltip("Toggle the deactivation state of the selected items.\nIf none are selected, a\
ll are set.");
deactivate_toggle->labelsize(11);
deactivate_toggle->callback((Fl_Callback*)cb_deactivate_toggle);
} // Fl_Light_Button* deactivate_toggle
- { bold_toggle = new Fl_Light_Button(280, 644, 90, 16, " Bold Font");
+ { bold_toggle = new Fl_Light_Button(280, 652, 90, 16, " Bold Font");
bold_toggle->tooltip("Toggles bold font for selected items\nIf nothing selected, all are changed");
bold_toggle->labelsize(11);
bold_toggle->callback((Fl_Callback*)cb_bold_toggle);
} // Fl_Light_Button* bold_toggle
- { insertabove_button = new Fl_Button(380, 624, 90, 16, "Insert Above");
+ { insertabove_button = new Fl_Button(380, 632, 90, 16, "Insert Above");
insertabove_button->tooltip("Inserts three items above the selected items");
insertabove_button->labelsize(11);
insertabove_button->callback((Fl_Callback*)cb_insertabove_button);
} // Fl_Button* insertabove_button
- { rebuildtree_button = new Fl_Button(380, 644, 90, 16, "Rebuild Tree");
+ { rebuildtree_button = new Fl_Button(380, 652, 90, 16, "Rebuild Tree");
rebuildtree_button->tooltip("Rebuilds the tree with defaults");
rebuildtree_button->labelsize(11);
rebuildtree_button->callback((Fl_Callback*)cb_rebuildtree_button);
} // Fl_Button* rebuildtree_button
- { clearselected_button = new Fl_Button(475, 624, 90, 16, "Clear Selected");
+ { clearselected_button = new Fl_Button(475, 632, 90, 16, "Clear Selected");
clearselected_button->tooltip("Clears the selected items");
clearselected_button->labelsize(11);
clearselected_button->callback((Fl_Callback*)cb_clearselected_button);
} // Fl_Button* clearselected_button
- { clearall_button = new Fl_Button(475, 644, 90, 16, "Clear All");
+ { clearall_button = new Fl_Button(475, 652, 90, 16, "Clear All");
clearall_button->tooltip("Clears all items\nTests Fl_Tree::clear()");
clearall_button->labelsize(11);
clearall_button->callback((Fl_Callback*)cb_clearall_button);
} // Fl_Button* clearall_button
+ { loaddb_button = new Fl_Button(380, 612, 90, 16, "Load Database...");
+ loaddb_button->tooltip("Load the contents of an Fl_Preferences databse into the tree view");
+ loaddb_button->labelsize(11);
+ loaddb_button->callback((Fl_Callback*)cb_loaddb_button);
+ } // Fl_Button* loaddb_button
window->end();
} // Fl_Double_Window* window
// Initialize Tree
diff --git a/test/tree.fl b/test/tree.fl
index a5070891a..9e70d00dd 100644
--- a/test/tree.fl
+++ b/test/tree.fl
@@ -20,7 +20,13 @@ decl {\#include <FL/Fl_Tree.H>} {public global
decl {\#include <FL/fl_ask.H>} {public global
}
-Function {Button_CB(Fl_Widget*w, void*data)} {open return_type void
+decl {\#include <FL/Fl_File_Chooser.H>} {selected public global
+}
+
+decl {\#include <FL/Fl_Preferences.H>} {public global
+}
+
+Function {Button_CB(Fl_Widget*w, void*data)} {return_type void
} {
code {fprintf(stderr, "'%s' button pushed\\n", w->label());} {}
}
@@ -109,7 +115,7 @@ Function {} {open
} {
Fl_Window window {
label tree open
- xywh {1105 30 580 695} type Double visible
+ xywh {1105 44 580 695} type Double visible
} {
Fl_Group tree {
user_data 1234
@@ -130,7 +136,7 @@ if ( item ) {
callback {int val = (int)margintop_slider->value();
tree->margintop(val);
tree->redraw();}
- tooltip {Changes the top margin for the tree widget} xywh {190 414 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12
+ tooltip {Changes the top margin for the tree widget} xywh {190 414 240 16} type Horizontal labelsize 12 align 4 textsize 12
code0 {o->value(tree->margintop());}
code1 {o->range(0.0, 100.0);}
code2 {o->step(1.0);}
@@ -142,7 +148,7 @@ tree->redraw();}
callback {int val = (int)marginleft_slider->value();
tree->marginleft(val);
tree->redraw();}
- tooltip {Changes the left margin for the tree widget} xywh {190 434 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12
+ tooltip {Changes the left margin for the tree widget} xywh {190 434 240 16} type Horizontal labelsize 12 align 4 textsize 12
code0 {o->value(tree->marginleft());}
code1 {o->range(0.0, 100.0);}
code2 {o->step(1.0);}
@@ -154,7 +160,7 @@ tree->redraw();}
callback {int val = (int)openchild_marginbottom_slider->value();
tree->openchild_marginbottom(val);
tree->redraw();}
- tooltip {Changes the vertical space below an open child tree} xywh {190 454 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12
+ tooltip {Changes the vertical space below an open child tree} xywh {190 454 240 16} type Horizontal labelsize 12 align 4 textsize 12
code0 {o->value(tree->openchild_marginbottom());}
code1 {o->range(0.0, 100.0);}
code2 {o->step(1.0);}
@@ -183,7 +189,7 @@ if ( ! count ) {
tree->redraw();}
tooltip {Changes the font size of the selected items
-If none selected, all are changed} xywh {190 474 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12
+If none selected, all are changed} xywh {190 474 240 16} type Horizontal labelsize 12 align 4 textsize 12
code0 {o->value(tree->labelsize());}
code1 {o->range(5.0, 200.0);}
code2 {o->step(1.0);}
@@ -193,9 +199,9 @@ If none selected, all are changed} xywh {190 474 240 16} type Horizontal labelsi
label {Connector width}
user_data tree
callback {tree->connectorwidth((int)connectorwidth_slider->value());}
- tooltip {Tests Fl_Tree::connectorwidth()} xywh {190 494 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12
+ tooltip {Tests Fl_Tree::connectorwidth()} xywh {190 494 240 16} type Horizontal labelsize 12 align 4 textsize 12
code0 {o->value(tree->connectorwidth());}
- code1 {o->range(10.0, 100.0);}
+ code1 {o->range(1.0, 100.0);}
code2 {o->step(1.0);}
code3 {o->color(46); o->selection_color(FL_RED);}
}
@@ -250,19 +256,36 @@ if ( usericon_radio->value() ) {
if ( ( i = tree->find_item("Bbb/bgb/222") ) != NULL ) i->usericon(0);
if ( ( i = tree->find_item("Bbb/bgb/333") ) != NULL ) i->usericon(0);
}}
- tooltip {Tests Fl_Tree_Item::usericon()} xywh {145 520 130 16} down_box DOWN_BOX labelsize 11
+ tooltip {Tests Fl_Tree_Item::usericon()} xywh {145 525 130 16} down_box DOWN_BOX labelsize 11
}
Fl_Check_Button showroot_radio {
label {Show root?}
user_data tree
callback {int onoff = showroot_radio->value();
tree->showroot(onoff);}
- tooltip {Tests Fl_Tree_Item::usericon()} xywh {145 539 130 16} down_box DOWN_BOX labelsize 11
+ tooltip {Tests Fl_Tree_Item::usericon()} xywh {145 544 130 16} down_box DOWN_BOX labelsize 11
code0 {int onoff = tree->showroot(); showroot_radio->value(onoff);}
}
Fl_Choice collapseicons_chooser {
label {Collapse icons}
callback {static const char *L_open_xpm[] = {
+\#ifdef __APPLE__
+ "11 11 3 1",
+ ". c \#fefefe",
+ "\# c \#444444",
+ "@ c \#000000",
+ "\#\#\#\#\#\#\#\#\#\#\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#....@....\#",
+ "\#....@....\#",
+ "\#..@@@@@..\#",
+ "\#....@....\#",
+ "\#....@....\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#\#\#\#\#\#\#\#\#\#\#"
+\#else
"11 11 2 1",
". c None",
"@ c \#000000",
@@ -276,10 +299,29 @@ tree->showroot(onoff);}
"...@@@@....",
"...@@@.....",
"...@@......",
- "...@......."};
+ "...@......."
+\#endif
+ };
static Fl_Pixmap L_openpixmap(L_open_xpm);
static const char *L_close_xpm[] = {
+\#ifdef __APPLE__
+ "11 11 3 1",
+ ". c \#fefefe",
+ "\# c \#444444",
+ "@ c \#000000",
+ "\#\#\#\#\#\#\#\#\#\#\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#..@@@@@..\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#.........\#",
+ "\#\#\#\#\#\#\#\#\#\#\#"
+\#else
"11 11 2 1",
". c None",
"@ c \#000000",
@@ -293,7 +335,9 @@ static const char *L_close_xpm[] = {
"..@@@@@@@..",
"...@@@@@...",
"....@@@....",
- ".....@....."};
+ ".....@....."
+\#endif
+ };
static Fl_Pixmap L_closepixmap(L_close_xpm);
switch ( collapseicons_chooser->value() ) {
@@ -311,14 +355,14 @@ switch ( collapseicons_chooser->value() ) {
tree->showcollapse(0);
break;
}} open
- tooltip {Tests Fl_Tree::openicon() and Fl_Tree::closeicon()} xywh {145 564 110 16} down_box BORDER_BOX labelsize 11 textsize 11
+ tooltip {Tests Fl_Tree::openicon() and Fl_Tree::closeicon()} xywh {145 572 110 16} down_box BORDER_BOX labelsize 11 textsize 11
} {
MenuItem {} {
label Normal
xywh {0 0 36 21} labelsize 11
}
MenuItem {} {
- label Arrow
+ label Custom
xywh {10 10 36 21} labelsize 11
}
MenuItem {} {
@@ -334,8 +378,8 @@ switch ( connectorstyle_chooser->value() ) {
case 1: tree->connectorstyle(FL_TREE_CONNECTOR_DOTTED); break;
case 2: tree->connectorstyle(FL_TREE_CONNECTOR_SOLID); break;
}} open
- tooltip {Tests connectorstyle() bit flags} xywh {145 584 110 16} down_box BORDER_BOX labelsize 11 textsize 11
- code0 {connectorstyle_chooser->value(1); // tree's default is 'dotted'}
+ tooltip {Tests connectorstyle() bit flags} xywh {145 592 110 16} down_box BORDER_BOX labelsize 11 textsize 11
+ code0 {switch (tree->connectorstyle()) { case FL_TREE_CONNECTOR_NONE: connectorstyle_chooser->value(0); break; case FL_TREE_CONNECTOR_DOTTED: connectorstyle_chooser->value(1); break; case FL_TREE_CONNECTOR_SOLID: connectorstyle_chooser->value(2); break; }}
} {
MenuItem {} {
label None
@@ -380,7 +424,7 @@ if ( ! count ) {
tree->redraw();} open
tooltip {Changes the label color for the selected items
-If no items selected, all are changed} xywh {145 604 110 16} down_box BORDER_BOX labelsize 11 textsize 11
+If no items selected, all are changed} xywh {145 612 110 16} down_box BORDER_BOX labelsize 11 textsize 11
} {
MenuItem {} {
label Black
@@ -408,7 +452,7 @@ switch ( selectmode_chooser->value() ) {
case 2: tree->selectmode(FL_TREE_SELECT_MULTI); break; // Multi
default: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single
}}
- tooltip {Sets how Fl_Tree handles mouse selection of tree items} xywh {145 624 110 16} down_box BORDER_BOX labelsize 11 textsize 11
+ tooltip {Sets how Fl_Tree handles mouse selection of tree items} xywh {145 632 110 16} down_box BORDER_BOX labelsize 11 textsize 11
code0 {selectmode_chooser->value(1);}
code1 {cb_selectmode_chooser(selectmode_chooser, (void*)0);}
} {
@@ -434,7 +478,7 @@ switch ( whenmode_chooser->value() ) {
case 2: tree->when(FL_WHEN_NEVER); break;
default: tree->when(FL_WHEN_RELEASE); break;
}}
- tooltip {Sets when() the tree's callback is invoked} xywh {145 644 110 16} down_box BORDER_BOX labelsize 11 textsize 11
+ tooltip {Sets when() the tree's callback is invoked} xywh {145 652 110 16} down_box BORDER_BOX labelsize 11 textsize 11
code0 {whenmode_chooser->value(1);}
code1 {cb_whenmode_chooser(whenmode_chooser, (void*)0);}
} {
@@ -527,7 +571,7 @@ if ( count == 0 ) {
tree->redraw();}
tooltip {Toggle the deactivation state of the selected items.
-If none are selected, all are set.} xywh {280 625 90 16} labelsize 11
+If none are selected, all are set.} xywh {280 633 90 16} labelsize 11
}
Fl_Light_Button bold_toggle {
label { Bold Font}
@@ -551,7 +595,7 @@ if ( ! count ) {
tree->redraw();}
tooltip {Toggles bold font for selected items
-If nothing selected, all are changed} xywh {280 644 90 16} labelsize 11
+If nothing selected, all are changed} xywh {280 652 90 16} labelsize 11
}
Fl_Button insertabove_button {
label {Insert Above}
@@ -566,12 +610,12 @@ while (item) {
}
tree->redraw();}
- tooltip {Inserts three items above the selected items} xywh {380 624 90 16} labelsize 11
+ tooltip {Inserts three items above the selected items} xywh {380 632 90 16} labelsize 11
}
Fl_Button rebuildtree_button {
label {Rebuild Tree}
callback {RebuildTree();}
- tooltip {Rebuilds the tree with defaults} xywh {380 644 90 16} labelsize 11
+ tooltip {Rebuilds the tree with defaults} xywh {380 652 90 16} labelsize 11
}
Fl_Button clearselected_button {
label {Clear Selected}
@@ -586,14 +630,25 @@ while (item) {
}
tree->redraw();}
- tooltip {Clears the selected items} xywh {475 624 90 16} labelsize 11
+ tooltip {Clears the selected items} xywh {475 632 90 16} labelsize 11
}
Fl_Button clearall_button {
label {Clear All}
callback {tree->clear();
-tree->redraw();} selected
+tree->redraw();}
tooltip {Clears all items
-Tests Fl_Tree::clear()} xywh {475 644 90 16} labelsize 11
+Tests Fl_Tree::clear()} xywh {475 652 90 16} labelsize 11
+ }
+ Fl_Button loaddb_button {
+ label {Load Database...}
+ callback {const char *filename = fl_file_chooser("Select a Preferences style Databse", "Preferences(*.prefs)", 0L);
+if (filename) {
+ tree->clear();
+ Fl_Preferences prefs(filename, 0L, 0L);
+ tree->load(prefs);
+ tree->redraw();
+}}
+ tooltip {Load the contents of an Fl_Preferences databse into the tree view} xywh {380 612 90 16} labelsize 11
}
}
code {// Initialize Tree
diff --git a/test/tree.h b/test/tree.h
index e479bff11..c25437b93 100644
--- a/test/tree.h
+++ b/test/tree.h
@@ -9,6 +9,8 @@
#include <FL/Fl_Group.H>
#include <FL/Fl_Tree.H>
#include <FL/fl_ask.H>
+#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_Preferences.H>
void Button_CB(Fl_Widget*w, void*data);
void RebuildTree();
#include <FL/Fl_Double_Window.H>
@@ -44,6 +46,7 @@ extern Fl_Button *insertabove_button;
extern Fl_Button *rebuildtree_button;
extern Fl_Button *clearselected_button;
extern Fl_Button *clearall_button;
+extern Fl_Button *loaddb_button;
extern Fl_Menu_Item menu_collapseicons_chooser[];
extern Fl_Menu_Item menu_connectorstyle_chooser[];
extern Fl_Menu_Item menu_labelcolor_chooser[];