diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2012-01-18 15:15:04 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2012-01-18 15:15:04 +0000 |
| commit | 82b6725d166d507755153c4cdd20d3a879ae7846 (patch) | |
| tree | a80af275d0c9f1bf0b30d3239b0b3c9be0fca976 /test | |
| parent | 92d846caa4140f021e1732d3e4f434d825960fde (diff) | |
Added text constants for preference names (project and application) for
easier testing (removed duplicated strings).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9229 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
| -rw-r--r-- | test/preferences.fl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/preferences.fl b/test/preferences.fl index be093b3a8..a72ab28c2 100644 --- a/test/preferences.fl +++ b/test/preferences.fl @@ -23,6 +23,12 @@ decl {void readPrefs();} {public local decl {void writePrefs();} {public local } +decl {const char *project = "fltk.org";} {private local +} + +decl {const char *application = "test/preferences";} {private local +} + Function {closeWindowCB( Fl_Widget*, void* )} {open private return_type void } { code {Fl::delete_widget(myWindow);} {} @@ -39,7 +45,7 @@ Function {} {open return_type int Fl_Window myWindow { label {My Preferences} callback closeWindowCB open - xywh {394 64 298 311} type Double visible + xywh {709 76 298 311} type Double visible } { Fl_Button {} { label Cancel @@ -195,7 +201,7 @@ int intValue; char buffer[80]; double doubleValue; -Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" ); +Fl_Preferences app( Fl_Preferences::USER, project, application ); char path[ FL_PATH_MAX ]; app.getUserdataPath( path, sizeof(path) ); @@ -262,12 +268,13 @@ Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" ); eat.get( "binFoo", (void*)&hex, 0, 0, sizeof( unsigned int ) ); void *data; eat.get( "binFoo2", data, 0, 0 ); - **/} {} + **/} {selected + } } Function {writePrefs()} {open return_type void } { - code {Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" ); + code {Fl_Preferences app( Fl_Preferences::USER, project, application ); Fl_Preferences bed( app, "Bed" ); @@ -323,6 +330,5 @@ Function {writePrefs()} {open return_type void /* sample code only: */ unsigned int hex = 0x2387efcd; eat.set( "binFoo", (void*)&hex, sizeof( unsigned int ) ); - eat.set( "binFoo2", (void*)&bed, 256 );} {selected - } + eat.set( "binFoo2", (void*)&bed, 256 );} {} } |
