Changeset 15
- Timestamp:
- 08/05/08 00:59:54 (2 years ago)
- Files:
-
- trunk/llmozlib2/llembeddedbrowser.cpp (modified) (6 diffs)
- trunk/llmozlib2/llembeddedbrowserwindow.cpp (modified) (2 diffs)
- trunk/llmozlib2/llembeddedbrowserwindow.h (modified) (1 diff)
- trunk/llmozlib2/llmozlib2.cpp (modified) (1 diff)
- trunk/llmozlib2/llmozlib2.h (modified) (1 diff)
- trunk/llmozlib2/tests/dependencies/include/glui.h (modified) (111 diffs)
- trunk/llmozlib2/tests/dependencies/lib/glui32.lib (modified) (previous)
- trunk/llmozlib2/tests/ubrowser/ubrowser.cpp (modified) (7 diffs)
- trunk/llmozlib2/tests/ubrowser/ubrowser.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/llmozlib2/llembeddedbrowser.cpp
r8 r15 45 45 #endif // WIN32 46 46 47 #include <iostream> 48 47 49 #include "llembeddedbrowser.h" 48 50 #include "llembeddedbrowserwindow.h" … … 61 63 #include "nsXULAppAPI.h" 62 64 #include "nsIAppShell.h" 63 64 #i f defined(LL_LINUX) || defined(LL_DARWIN)65 #include "nsIPromptService.h" 66 #include "time.h" 65 67 #include "nsWidgetsCID.h" 68 #include "nsNetCID.h" 69 66 70 static nsIAppShell *sAppShell = nsnull; 67 #endif // defined(LL_LINUX) || defined(LL_DARWIN)68 71 69 72 // singleton pattern - initialization … … 206 209 enableProxy( false, "", 0 ); 207 210 208 #if defined(LL_LINUX) || defined(LL_DARWIN) 209 // Essential on Linux/GTK to add the gecko pump to the GTK event 210 // loop. Might be harmless/good on other platforms too. 211 // Originally from Linux version but seems to help other platforms too 211 212 nsresult rv; 212 213 nsCOMPtr<nsIAppShell> appShell; … … 222 223 sAppShell->Create(0, nsnull); 223 224 sAppShell->Spinup(); 224 #endif // LL_LINUX225 225 226 226 clearLastError(); … … 399 399 }; 400 400 401 401 402 //////////////////////////////////////////////////////////////////////////////// 402 403 // … … 421 422 }; 422 423 424 423 425 browserWindowIn->SetWebBrowser( nsnull ); 424 426 trunk/llmozlib2/llembeddedbrowserwindow.cpp
r8 r15 595 595 return PR_FALSE; 596 596 597 597 598 // get pres context 598 599 nsCOMPtr< nsPresContext > presContext; … … 868 869 if ( mWebNav ) 869 870 mWebNav->GoForward(); 871 }; 872 873 //////////////////////////////////////////////////////////////////////////////// 874 // 875 void LLEmbeddedBrowserWindow::navigateReload() 876 { 877 // maybe need a cache version of this too? 878 if ( mWebNav ) 879 mWebNav->Reload( nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE ); 870 880 }; 871 881 trunk/llmozlib2/llembeddedbrowserwindow.h
r8 r15 195 195 PRBool canNavigateForward(); 196 196 void navigateForward(); 197 void navigateReload(); 197 198 198 199 // javascript access/control trunk/llmozlib2/llmozlib2.cpp
r9 r15 374 374 } 375 375 376 //////////////////////////////////////////////////////////////////////////////// 377 // 378 bool LLMozLib::navigateReload( int browserWindowIdIn ) 379 { 380 LLEmbeddedBrowserWindow* browserWindow = getBrowserWindowFromWindowId( browserWindowIdIn ); 381 if ( browserWindow ) 382 { 383 browserWindow->navigateReload(); 384 385 return true; 386 }; 387 388 return false; 389 } 390 376 391 /////////////////////////////////////////////////////////////////////////////// 377 392 // trunk/llmozlib2/llmozlib2.h
r9 r15 211 211 bool canNavigateForward( int browserWindowIdIn ); 212 212 bool navigateForward( int browserWindowIdIn ); 213 bool navigateReload( int browserWindowIdIn ); 213 214 214 215 // javascript access/control trunk/llmozlib2/tests/dependencies/include/glui.h
r1 r15 1 1 /**************************************************************************** 2 2 3 GLUI User Interface Toolkit (LGPL)4 --------------------------- -------5 6 glui.h - Main (and only) external header for 3 GLUI User Interface Toolkit 4 --------------------------- 5 6 glui.h - Main (and only) external header for 7 7 GLUI User Interface Toolkit 8 8 … … 14 14 Forums: http://sourceforge.net/forum/?group_id=92496 15 15 16 This library is free software; you can redistribute it and/or 17 modify it under the terms of the GNU Lesser General Public 18 License as published by the Free Software Foundation; either 19 version 2.1 of the License, or (at your option) any later version. 20 21 This library is distributed in the hope that it will be useful, 22 but WITHOUT ANY WARRANTY; without even the implied warranty of 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 Lesser General Public License for more details. 25 26 You should have received a copy of the GNU Lesser General Public 27 License along with this library; if not, write to the Free Software 28 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 This software is provided 'as-is', without any express or implied 17 warranty. In no event will the authors be held liable for any damages 18 arising from the use of this software. 19 20 Permission is granted to anyone to use this software for any purpose, 21 including commercial applications, and to alter it and redistribute it 22 freely, subject to the following restrictions: 23 24 1. The origin of this software must not be misrepresented; you must not 25 claim that you wrote the original software. If you use this software 26 in a product, an acknowledgment in the product documentation would be 27 appreciated but is not required. 28 2. Altered source versions must be plainly marked as such, and must not be 29 misrepresented as being the original software. 30 3. This notice may not be removed or altered from any source distribution. 29 31 30 32 *****************************************************************************/ … … 33 35 #define GLUI_GLUI_H 34 36 37 // Having stdlib here first fixes some 'exit() redefined' errors on MSVC.NET 38 // that come from old GLUT headers. 39 #include <cstdlib> 40 35 41 #if defined(GLUI_FREEGLUT) 36 42 37 43 // FreeGLUT does not yet work perfectly with GLUI 38 44 // - use at your own risk. 39 45 40 46 #include <GL/freeglut.h> 41 47 … … 44 50 // OpenGLUT does not yet work properly with GLUI 45 51 // - use at your own risk. 46 52 47 53 #include <GL/openglut.h> 48 54 49 #else 55 #else 50 56 51 57 #ifdef __APPLE__ … … 57 63 #endif 58 64 59 #include <cstdlib>60 65 #include <cstdio> 61 66 #include <cstring> … … 63 68 #include <vector> 64 69 65 #define GLUI_VERSION 2.3f /********** Current version **********/ 66 70 /* GLUI API shared library export/import declarations. */ 67 71 #if defined(_WIN32) 68 #if !defined(GLUI_NO_LIB_PRAGMA) 69 #pragma comment(lib, "glui32.lib") // Link automatically with GLUI library 72 # ifdef GLUI_BUILDING_LIB 73 # ifdef GLUIDLL 74 # define GLUIAPI __declspec(dllexport) 75 # else 76 # define GLUIAPI 77 # endif 78 # else 79 # ifdef GLUIDLL 80 # define GLUIAPI __declspec(dllimport) 81 # else 82 # define GLUIAPI 83 # endif 84 # endif 85 #else 86 #define GLUIAPI 70 87 #endif 88 89 90 #define GLUI_VERSION 2.36f /********** Current version **********/ 91 92 #if defined(_WIN32) 93 # if !defined(GLUI_NO_LIB_PRAGMA) && !defined(GLUI_BUILDING_LIB) 94 // Link automatically with GLUI library 95 # if defined GLUIDLL // define this when using glui dynamic library 96 # pragma comment(lib, "glui32dll.lib") 97 # else 98 # pragma comment(lib, "glui32.lib") 99 # endif 100 # endif 71 101 #endif 72 102 73 /********** Do some basic defines *******/74 75 #ifndef Byte76 #define Byte unsigned char77 #endif78 79 #ifndef _RGBC_80 class RGBc {81 public:82 Byte r, g, b;83 84 void set(Byte r,Byte g,Byte b) {this->r=r;this->g=g;this->b=b;}85 86 RGBc( void ) {}87 RGBc( Byte r, Byte g, Byte b ) { set( r, g, b ); }88 };89 #define _RGBC_90 #endif91 103 92 104 /********** List of GLUT callbacks ********/ 93 105 94 enum GLUI_Glut_CB_Types 95 { 106 enum GLUI_Glut_CB_Types 107 { 96 108 GLUI_GLUT_RESHAPE, 97 109 GLUI_GLUT_KEYBOARD, … … 100 112 GLUI_GLUT_MOTION, 101 113 GLUI_GLUT_SPECIAL, 102 GLUI_GLUT_PASSIVE_MOTION, 114 GLUI_GLUT_PASSIVE_MOTION, 103 115 GLUI_GLUT_ENTRY, 104 GLUI_GLUT_VISIBILITY 116 GLUI_GLUT_VISIBILITY 105 117 }; 106 118 … … 116 128 #define GLUI_SEPARATOR_HEIGHT 8 117 129 #define GLUI_DEFAULT_CONTROL_WIDTH 100 118 #define GLUI_DEFAULT_CONTROL_HEIGHT 13 130 #define GLUI_DEFAULT_CONTROL_HEIGHT 13 119 131 #define GLUI_EDITTEXT_BOXINNERMARGINX 3 120 132 #define GLUI_EDITTEXT_HEIGHT 20 … … 199 211 #define GLUI_TREEPANEL_HIERARCHY_NUMERICDOT 64 // display hierarchy in 1.3.2 (etc... ) format 200 212 #define GLUI_TREEPANEL_HIERARCHY_LEVEL_ONLY 128 // display hierarchy as only the level depth 201 213 202 214 /******************* GLUI Scrollbar Defaults - JVK ***************************/ 203 215 #define GLUI_SCROLL_ARROW_WIDTH 16 … … 215 227 216 228 217 /** Size of the character width hash table for faster lookups. 229 /** Size of the character width hash table for faster lookups. 218 230 Make sure to keep this a power of two to avoid the slow divide. 219 231 This is also a speed/memory tradeoff; 128 is enough for low ASCII. … … 223 235 /********** Translation codes **********/ 224 236 225 enum TranslationCodes 237 enum TranslationCodes 226 238 { 227 239 GLUI_TRANSLATION_MOUSE_NONE = 0, … … 239 251 240 252 typedef std::string GLUI_String; 241 GLUI _String& glui_format_str(GLUI_String &str, const char* fmt, ...);253 GLUIAPI GLUI_String& glui_format_str(GLUI_String &str, const char* fmt, ...); 242 254 243 255 /********* Pre-declare classes as needed *********/ … … 287 299 /************************************************************/ 288 300 /** 289 Callback Adapter Class 301 Callback Adapter Class 290 302 Allows us to support different types of callbacks; 291 303 like a GLUI_Update_CB function pointer--which takes an int; 292 304 and a GLUI_Control_CB function pointer--which takes a GUI_Control object. 293 305 */ 294 class GLUI _CB306 class GLUIAPI GLUI_CB 295 307 { 296 308 public: … … 321 333 Each GLUI_Node has a list of siblings (in a circular list) 322 334 and a linked list of children. 323 335 324 336 Everything onscreen is a GLUI_Node--windows, buttons, etc. 325 337 The nodes are traversed for event processing, sizing, redraws, etc. 326 338 */ 327 class GLUI _Node339 class GLUIAPI GLUI_Node 328 340 { 329 341 friend class GLUI_Tree; /* JVK */ … … 371 383 /************************************************************/ 372 384 373 enum GLUI_StdBitmaps_Codes 385 enum GLUI_StdBitmaps_Codes 374 386 { 375 387 GLUI_STDBITMAP_CHECKBOX_OFF = 0, … … 408 420 via the GLUI_StdBitmaps class. 409 421 */ 410 class GLUI _Bitmap422 class GLUIAPI GLUI_Bitmap 411 423 { 412 424 friend class GLUI_StdBitmaps; … … 418 430 /** Create bitmap from greyscale byte image */ 419 431 void init_grey(unsigned char *array); 420 432 421 433 /** Create bitmap from color int image */ 422 434 void init(int *array); … … 436 448 437 449 /** 438 Keeps an array of GLUI_Bitmap objects to represent all the 450 Keeps an array of GLUI_Bitmap objects to represent all the 439 451 images used in the UI: checkboxes, arrows, etc. 440 452 */ 441 class GLUI _StdBitmaps442 { 443 public: 444 GLUI_StdBitmaps(); 453 class GLUIAPI GLUI_StdBitmaps 454 { 455 public: 456 GLUI_StdBitmaps(); 445 457 ~GLUI_StdBitmaps(); 446 458 … … 451 463 452 464 /** Draw the n'th standard bitmap (one of the enums 453 listed in GLUI_StdBitmaps_Codes) at pixel corner (x,y). 465 listed in GLUI_StdBitmaps_Codes) at pixel corner (x,y). 454 466 */ 455 467 void draw(int n, int x, int y) const; … … 469 481 There's only one GLUI_Master_Object. 470 482 */ 471 class GLUI _Master_Object483 class GLUIAPI GLUI_Master_Object 472 484 { 473 485 474 486 friend void glui_idle_func(); 475 487 476 488 public: 477 489 … … 524 536 void set_glutMenuStateFunc(Int1_CB f) {glutMenuStateFunc(f);} 525 537 void set_glutButtonBoxFunc(Int2_CB f) {glutButtonBoxFunc(f);} 526 void set_glutDialsFunc(Int2_CB f) {glutDialsFunc(f);} 527 528 529 GLUI *create_glui( const char *name, long flags=0, int x=-1, int y=-1 ); 538 void set_glutDialsFunc(Int2_CB f) {glutDialsFunc(f);} 539 540 541 GLUI *create_glui( const char *name, long flags=0, int x=-1, int y=-1 ); 530 542 GLUI *create_glui_subwindow( int parent_window, long flags=0 ); 531 543 GLUI *find_glui_by_window_id( int window_id ); … … 551 563 This is the only GLUI_Master_Object in existence. 552 564 */ 553 extern GLUI _Master_Object GLUI_Master;565 extern GLUIAPI GLUI_Master_Object GLUI_Master; 554 566 555 567 /************************************************************/ … … 563 575 to the callbacks in this class, for arbitrary use by external users. 564 576 (see GLUI_Master_Object::set_glutKeyboardFunc). 565 577 566 578 This entire approach seems to be superceded by the "subwindow" flavor 567 579 of GLUI. 568 580 */ 569 class GLUI _Glut_Window : public GLUI_Node581 class GLUIAPI GLUI_Glut_Window : public GLUI_Node 570 582 { 571 583 public: … … 593 605 594 606 /** 595 A GLUI_Main handles GLUT events for one window, routing them to the 596 appropriate controls. The central user-visible "GLUI" class 607 A GLUI_Main handles GLUT events for one window, routing them to the 608 appropriate controls. The central user-visible "GLUI" class 597 609 inherits from this class; users should not allocate GLUT_Main objects. 598 610 599 611 There's a separate GLUI_Main object for: 600 612 - Each top-level window with GUI stuff in it. … … 605 617 this class provides the window-level context for every control. 606 618 */ 607 class GLUI _Main : public GLUI_Node619 class GLUIAPI GLUI_Main : public GLUI_Node 608 620 { 609 621 /********** Friend classes *************/ … … 649 661 int curr_cursor; 650 662 int w, h; 651 long flags; 663 long flags; 652 664 bool closing; 653 665 int parent_window; … … 695 707 GLUI_StdBitmaps std_bitmaps; 696 708 GLUI_String window_name; 697 RGBc bkgd_color;709 unsigned char bkgd_color[3]; 698 710 float bkgd_color_f[3]; 699 711 … … 705 717 void align_controls( GLUI_Control *control ); 706 718 void deactivate_current_control( void ); 707 719 708 720 /** Draw a 3D-look pushed-out box around this rectangle */ 709 721 void draw_raised_box( int x, int y, int w, int h ); 710 722 /** Draw a 3D-look pushed-in box around this rectangle */ 711 723 void draw_lowered_box( int x, int y, int w, int h ); 712 724 713 725 /** Return true if this control should redraw itself immediately (front buffer); 714 726 Or queue up a redraw and return false if it shouldn't (back buffer). 715 727 */ 716 728 bool should_redraw_now(GLUI_Control *ctl); 717 718 /** Switch to the appropriate draw buffer now. Returns the old draw buffer. 729 730 /** Switch to the appropriate draw buffer now. Returns the old draw buffer. 719 731 This routine should probably only be called from inside the GLUI_DrawingSentinal, 720 732 in glui_internal_control.h … … 723 735 /** Go back to using this draw buffer. Undoes set_current_draw_buffer. */ 724 736 void restore_draw_buffer( int buffer_state ); 725 737 726 738 /** Pack, resize the window, and redraw all the controls. */ 727 739 void refresh(); 728 740 729 741 /** Redraw the main graphics window */ 730 742 void post_update_main_gfx(); 731 743 732 744 /** Recompute the sizes and positions of all controls */ 733 745 void pack_controls(); 734 746 735 747 void close_internal(); 736 748 void check_subwindow_position(); … … 751 763 Most of the work of this class is in routing events, 752 764 like keystrokes, mouseclicks, redraws, and sizing events. 753 754 Yes, this is a huge and hideous class. It needs to be 765 766 Yes, this is a huge and hideous class. It needs to be 755 767 split up into simpler subobjects. None of the data members 756 768 should be directly accessed by users (they should be protected, 757 769 not public); only subclasses. 758 770 */ 759 class GLUI _Control : public GLUI_Node771 class GLUIAPI GLUI_Control : public GLUI_Node 760 772 { 761 773 public: … … 766 778 int x_off, y_off_top, y_off_bot; /* INNER margins, by which child 767 779 controls are indented */ 768 int contain_x, contain_y; 780 int contain_x, contain_y; 769 781 int contain_w, contain_h; 770 /* if this is a container control (e.g., 782 /* if this is a container control (e.g., 771 783 radiogroup or panel) this indicated dimensions 772 784 of inner area in which controls reside */ … … 777 789 bool can_activate; ///< If false, remove from tab order. 778 790 bool spacebar_mouse_click; ///< Spacebar simulates click. 779 791 780 792 /** Callbacks */ 781 793 long user_id; ///< Integer to pass to callback function. … … 788 800 int float_array_size; 789 801 GLUI_String text; /**< The text inside this control */ 790 802 791 803 /** "Live variable" updating */ 792 804 void *ptr_val; /**< A pointer to the user's live variable value */ … … 794 806 bool live_inited; 795 807 /* These variables store the last value that live variable was known to have. */ 796 int last_live_int; 808 int last_live_int; 797 809 float last_live_float; 798 810 GLUI_String last_live_text; 799 811 float last_live_float_array[GLUI_DEF_MAX_ARRAY]; 800 801 /** Properties of our control */ 812 813 /** Properties of our control */ 802 814 GLUI *glui; /**< Our containing event handler (NEVER NULL during event processing!) */ 803 815 bool is_container; /**< Is this a container class (e.g., panel) */ … … 835 847 virtual int mouse_over( int state, int x, int y ) { return false; } 836 848 837 virtual void enable( void ); 849 virtual void enable( void ); 838 850 virtual void disable( void ); 839 851 virtual void activate( int how ) { active = true; } … … 848 860 849 861 /** Redraw this control. 850 In single-buffering mode (drawing to GL_FRONT), this is just 862 In single-buffering mode (drawing to GL_FRONT), this is just 851 863 a call to translate_and_draw_front (after a can_draw() check). 852 In double-buffering mode (drawing to GL_BACK), this queues up 864 In double-buffering mode (drawing to GL_BACK), this queues up 853 865 a redraw and returns false, since you shouldn't draw yet. 854 866 */ 855 867 void redraw(void); 856 868 857 869 /** Redraw everybody in our window. */ 858 870 void redraw_window(void); … … 860 872 virtual void align( void ); 861 873 void pack( int x, int y ); /* Recalculate positions and offsets */ 862 void pack_old( int x, int y ); 874 void pack_old( int x, int y ); 863 875 void draw_recursive( int x, int y ); 864 876 int set_to_glut_window( void ); 865 877 void restore_window( int orig ); 866 878 void translate_and_draw_front( void ); 867 void translate_to_origin( void ) 879 void translate_to_origin( void ) 868 880 {glTranslatef((float)x_abs+.5,(float)y_abs+.5,0.0);} 869 881 virtual void draw( int x, int y )=0; … … 871 883 void *get_font( void ); 872 884 int string_width( const char *text ); 873 int string_width( const GLUI_String &str ) 885 int string_width( const GLUI_String &str ) 874 886 { return string_width(str.c_str()); } 875 887 int char_width( char c ); 876 888 877 889 void draw_name( int x, int y ); 878 void draw_box_inwards_outline( int x_min, int x_max, 890 void draw_box_inwards_outline( int x_min, int x_max, 879 891 int y_min, int y_max ); 880 892 void draw_box( int x_min, int x_max, int y_min, int y_max, … … 883 895 void draw_emboss_box( int x_min, int x_max,int y_min,int y_max); 884 896 void draw_string( const char *text ); 885 void draw_string( const GLUI_String &s ) 897 void draw_string( const GLUI_String &s ) 886 898 { draw_string(s.c_str()); } 887 899 void draw_char( char c ); … … 897 909 virtual void set_text( const char *t ) {} 898 910 void execute_callback( void ); 899 void get_this_column_dims( int *col_x, int *col_y, 900 int *col_w, int *col_h, 911 void get_this_column_dims( int *col_x, int *col_y, 912 int *col_w, int *col_h, 901 913 int *col_x_off, int *col_y_off ); 902 914 virtual bool needs_idle( void ) const; 903 915 virtual bool wants_tabs() const { return false; } 904 916 905 GLUI_Control(void) 917 GLUI_Control(void) 906 918 { 907 919 x_off = GLUI_XOFF; … … 950 962 /************************************************************/ 951 963 /** 952 An onscreen, clickable button--an outlined label that 964 An onscreen, clickable button--an outlined label that 953 965 can be clicked. When clicked, a button 954 966 calls its GLUI_CB callback with its ID. 955 967 */ 956 class GLUI _Button : public GLUI_Control968 class GLUIAPI GLUI_Button : public GLUI_Control 957 969 { 958 970 public: … … 972 984 /** 973 985 Create a new button. 974 986 975 987 @param parent The panel our object is inside; or the main GLUI object. 976 988 @param name The text inside the button. … … 978 990 @param callback Optional callback function, taking either the int ID or control. 979 991 */ 980 GLUI_Button( GLUI_Node *parent, const char *name, 992 GLUI_Button( GLUI_Node *parent, const char *name, 981 993 int id=-1, GLUI_CB cb=GLUI_CB() ); 982 994 GLUI_Button( void ) { common_init(); }; … … 1003 1015 to an int value, which gets 1 for on and 0 for off. 1004 1016 */ 1005 class GLUI _Checkbox : public GLUI_Control1017 class GLUIAPI GLUI_Checkbox : public GLUI_Control 1006 1018 { 1007 1019 public: … … 1025 1037 /** 1026 1038 Create a new checkbox object. 1027 1039 1028 1040 @param parent The panel our object is inside; or the main GLUI object. 1029 1041 @param name Label next to our checkbox. 1030 @param value_ptr Optional integer value to attach to this checkbox. When the 1042 @param value_ptr Optional integer value to attach to this checkbox. When the 1031 1043 checkbox is checked or unchecked, *value_ptr will also be changed. ("Live Vars"). 1032 1044 @param id Optional ID number, to pass to the optional callback function. … … 1059 1071 from subsequent controls with a vertical bar. 1060 1072 */ 1061 class GLUI _Column : public GLUI_Control1073 class GLUIAPI GLUI_Column : public GLUI_Control 1062 1074 { 1063 1075 public: … … 1067 1079 Create a new column, which separates the previous controls 1068 1080 from subsequent controls. 1069 1081 1070 1082 @param parent The panel our object is inside; or the main GLUI object. 1071 1083 @param draw_bar If true, draw a visible bar between new and old controls. … … 1093 1105 A GLUI_Panel contains a group of related controls. 1094 1106 */ 1095 class GLUI _Panel : public GLUI_Control1107 class GLUIAPI GLUI_Panel : public GLUI_Control 1096 1108 { 1097 1109 public: … … 1099 1111 /** 1100 1112 Create a new panel. A panel groups together a set of related controls. 1101 1113 1102 1114 @param parent The outer panel our panel is inside; or the main GLUI object. 1103 1115 @param name The string name at the top of our panel. … … 1106 1118 GLUI_PANEL_NONE causes the panel's outline to be invisible. 1107 1119 */ 1108 GLUI_Panel( GLUI_Node *parent, const char *name, 1120 GLUI_Panel( GLUI_Node *parent, const char *name, 1109 1121 int type=GLUI_PANEL_EMBOSSED ); 1110 1122 GLUI_Panel() { common_init(); } … … 1122 1134 int_val = GLUI_PANEL_EMBOSSED; 1123 1135 alignment = GLUI_ALIGN_CENTER; 1124 is_container = true; 1136 is_container = true; 1125 1137 can_activate = false; 1126 1138 name=""; … … 1137 1149 A list of files the user can select from. 1138 1150 */ 1139 class GLUI _FileBrowser : public GLUI_Panel1151 class GLUIAPI GLUI_FileBrowser : public GLUI_Panel 1140 1152 { 1141 1153 public: 1142 1154 /** 1143 1155 Create a new list of files the user can select from. 1144 1156 1145 1157 @param parent The panel our object is inside; or the main GLUI object. 1146 1158 @param name Prompt to give to the user at the top of the file browser. … … 1151 1163 @param callback Optional callback function, taking either the int ID or control. 1152 1164 */ 1153 GLUI_FileBrowser( GLUI_Node *parent, 1165 GLUI_FileBrowser( GLUI_Node *parent, 1154 1166 const char *name, 1155 1167 int frame_type = GLUI_PANEL_EMBOSSED, … … 1169 1181 1170 1182 protected: 1171 void common_init() 1183 void common_init() 1172 1184 { 1173 1185 w = GLUI_DEFAULT_CONTROL_WIDTH; … … 1175 1187 int_val = GLUI_PANEL_EMBOSSED; 1176 1188 alignment = GLUI_ALIGN_CENTER; 1177 is_container = true; 1189 is_container = true; 1178 1190 can_activate = false; 1179 1191 allow_change_dir = true; … … 1201 1213 like a panel, but can be collapsed to just the name. 1202 1214 */ 1203 class GLUI _Rollout : public GLUI_Panel1215 class GLUIAPI GLUI_Rollout : public GLUI_Panel 1204 1216 { 1205 1217 public: … … 1208 1220 Create a new rollout. A rollout contains a set of controls, 1209 1221 like a panel, but can be collapsed to just the name. 1210 1222 1211 1223 @param parent The panel our object is inside; or the main GLUI object. 1212 1224 @param name String to show at the top of the rollout. … … 1217 1229 GLUI_PANEL_NONE causes the panel's outline to be invisible. 1218 1230 */ 1219 GLUI_Rollout( GLUI_Node *parent, const char *name, int open=true, 1231 GLUI_Rollout( GLUI_Node *parent, const char *name, int open=true, 1220 1232 int type=GLUI_PANEL_EMBOSSED ); 1221 1233 GLUI_Rollout( void ) { common_init(); } 1222 1223 1234 1235 1224 1236 bool currently_inside, initially_inside; 1225 1237 GLUI_Button button; … … 1230 1242 int mouse_up_handler( int local_x, int local_y, bool inside ); 1231 1243 int mouse_held_down_handler( int local_x, int local_y, bool inside ); 1232 1233 void open( void ); 1244 1245 void open( void ); 1234 1246 void close( void ); 1235 1247 … … 1259 1271 One collapsible entry in a GLUI_TreePanel. 1260 1272 */ 1261 class GLUI _Tree : public GLUI_Panel1262 { 1263 public: 1264 GLUI_Tree(GLUI_Node *parent, const char *name, 1273 class GLUIAPI GLUI_Tree : public GLUI_Panel 1274 { 1275 public: 1276 GLUI_Tree(GLUI_Node *parent, const char *name, 1265 1277 int open=false, int inset=0); 1266 1278 … … 1284 1296 GLUI_Button button; 1285 1297 GLUI_String level_name; // level name, eg: 1.1.2, III, or 3 1286 GLUI_TreePanel *panel; 1298 GLUI_TreePanel *panel; 1287 1299 1288 1300 void draw( int x, int y ); … … 1292 1304 int mouse_held_down_handler( int local_x, int local_y, bool inside ); 1293 1305 void set_column(GLUI_Column *c) { column = c; } 1294 void open( void ); 1306 void open( void ); 1295 1307 void close( void ); 1296 1308 … … 1305 1317 int get_child_number() { return child_number; } 1306 1318 void enable_bar() { if (column) { column->int_val = 1; set_color(red, green, blue); } } 1307 void disable_bar() { if (column) { column->int_val = 0; } } 1308 void set_child_number(int c) { child_number = c; } 1309 void set_level_color(float r, float g, float b) { 1319 void disable_bar() { if (column) { column->int_val = 0; } } 1320 void set_child_number(int c) { child_number = c; } 1321 void set_level_color(float r, float g, float b) { 1310 1322 lred = r; 1311 1323 lgreen = g; 1312 1324 lblue = b; 1313 1325 } 1314 void set_color(float r, float g, float b) { 1326 void set_color(float r, float g, float b) { 1315 1327 red = r; 1316 1328 green = g; … … 1342 1354 level_name = ""; 1343 1355 level = 0; 1344 1356 1345 1357 }; 1346 1358 }; … … 1356 1368 Manages, maintains, and formats a tree of GLUI_Tree objects. 1357 1369 These are shown in a heirarchical, collapsible display. 1358 1370 1359 1371 FIXME: There's an infinite loop in the traversal code (OSL 2006/06) 1360 1372 */ 1361 class GLUI _TreePanel : public GLUI_Panel1373 class GLUIAPI GLUI_TreePanel : public GLUI_Panel 1362 1374 { 1363 1375 public: … … 1376 1388 int root_children; 1377 1389 /* These variables allow the tree panel to traverse the tree 1378 using only two function calls. (Well, four, if you count 1390 using only two function calls. (Well, four, if you count 1379 1391 going in reverse */ 1380 1392 … … 1383 1395 1384 1396 public: 1385 void set_color(float r, float g, float b); 1397 void set_color(float r, float g, float b); 1386 1398 void set_level_color(float r, float g, float b); 1387 1399 void set_format(int f) { format = f; } … … 1407 1419 protected: 1408 1420 int uniqueID( void ) { next_id++; return next_id - 1; } 1409 void common_init() 1421 void common_init() 1410 1422 { 1411 1423 GLUI_Panel(); … … 1431 1443 /** 1432 1444 The main user-visible interface object to GLUI. 1433 1434 */ 1435 class GLUI : public GLUI_Main1445 1446 */ 1447 class GLUIAPI GLUI : public GLUI_Main 1436 1448 { 1437 1449 public: … … 1445 1457 void add_separator_to_panel( GLUI_Panel *panel ); 1446 1458 1447 GLUI_RadioGroup 1459 GLUI_RadioGroup 1448 1460 *add_radiogroup( int *live_var=NULL, 1449 1461 int user_id=-1,GLUI_CB callback=GLUI_CB()); 1450 1462 1451 GLUI_RadioGroup 1463 GLUI_RadioGroup 1452 1464 *add_radiogroup_to_panel( GLUI_Panel *panel, 1453 1465 int *live_var=NULL, … … 1468 1480 const char *name, float *live_var=NULL, 1469 1481 int id=-1, GLUI_CB callback=GLUI_CB()); 1470 1482 1471 1483 GLUI_Translation *add_translation( const char *name, 1472 1484 int trans_type, float *live_var=NULL, 1473 1485 int id=-1, GLUI_CB callback=GLUI_CB() ); 1474 GLUI_Translation *add_translation_to_panel( 1475 GLUI_Panel *panel, const char *name, 1486 GLUI_Translation *add_translation_to_panel( 1487 GLUI_Panel *panel, const char *name, 1476 1488 int trans_type, float *live_var=NULL, 1477 1489 int id=-1, GLUI_CB callback=GLUI_CB()); 1478 1479 GLUI_Checkbox *add_checkbox( const char *name, 1490 1491 GLUI_Checkbox *add_checkbox( const char *name, 1480 1492 int *live_var=NULL, 1481 1493 int id=-1, GLUI_CB callback=GLUI_CB()); 1482 GLUI_Checkbox *add_checkbox_to_panel( GLUI_Panel *panel, const char *name, 1483 int *live_var=NULL, int id=-1, 1494 GLUI_Checkbox *add_checkbox_to_panel( GLUI_Panel *panel, const char *name, 1495 int *live_var=NULL, int id=-1, 1484 1496 GLUI_CB callback=GLUI_CB()); 1485 1497 1486 GLUI_Button *add_button( const char *name, int id=-1, 1498 GLUI_Button *add_button( const char *name, int id=-1, 1487 1499 GLUI_CB callback=GLUI_CB()); 1488 GLUI_Button *add_button_to_panel( GLUI_Panel *panel, const char *name, 1500 GLUI_Button *add_button_to_panel( GLUI_Panel *panel, const char *name, 1489 1501 int id=-1, GLUI_CB callback=GLUI_CB() ); 1490 1502 … … 1492 1504 GLUI_StaticText *add_statictext_to_panel( GLUI_Panel *panel, const char *name ); 1493 1505 1494 GLUI_EditText *add_edittext( const char *name, 1506 GLUI_EditText *add_edittext( const char *name, 1495 1507 int data_type=GLUI_EDITTEXT_TEXT, 1496 1508 void*live_var=NULL, 1497 1509 int id=-1, GLUI_CB callback=GLUI_CB() ); 1498 GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, 1510 GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, 1499 1511 const char *name, 1500 1512 int data_type=GLUI_EDITTEXT_TEXT, 1501 void *live_var=NULL, int id=-1, 1513 void *live_var=NULL, int id=-1, 1502 1514 GLUI_CB callback=GLUI_CB() ); 1503 GLUI_EditText *add_edittext( const char *name, GLUI_String& live_var, 1515 GLUI_EditText *add_edittext( const char *name, GLUI_String& live_var, 1504 1516 int id=-1, GLUI_CB callback=GLUI_CB() ); 1505 GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, const char *name, 1517 GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, const char *name, 1506 1518 GLUI_String& live_var, int id=-1, 1507 1519 GLUI_CB callback=GLUI_CB() ); 1508 1520 1509 GLUI_Spinner *add_spinner( const char *name, 1521 GLUI_Spinner *add_spinner( const char *name, 1510 1522 int data_type=GLUI_SPINNER_INT, 1511 1523 void *live_var=NULL, 1512 1524 int id=-1, GLUI_CB callback=GLUI_CB() ); 1513 GLUI_Spinner *add_spinner_to_panel( GLUI_Panel *panel, 1525 GLUI_Spinner *add_spinner_to_panel( GLUI_Panel *panel, 1514 1526 const char *name, 1515 1527 int data_type=GLUI_SPINNER_INT, … … 1519 1531 1520 1532 GLUI_Panel *add_panel( const char *name, int type=GLUI_PANEL_EMBOSSED ); 1521 GLUI_Panel *add_panel_to_panel( GLUI_Panel *panel, const char *name, 1533 GLUI_Panel *add_panel_to_panel( GLUI_Panel *panel, const char *name, 1522 1534 int type=GLUI_PANEL_EMBOSSED ); 1523 1535 … … 1525 1537 GLUI_Rollout *add_rollout( const char *name, int open=true, 1526 1538 int type=GLUI_PANEL_EMBOSSED); 1527 GLUI_Rollout *add_rollout_to_panel( GLUI_Panel *panel, const char *name, 1539 GLUI_Rollout *add_rollout_to_panel( GLUI_Panel *panel, const char *name, 1528 1540 int open=true, 1529 1541 int type=GLUI_PANEL_EMBOSSED); … … 1577 1589 /************************************************************/ 1578 1590 1579 class GLUI _EditText : public GLUI_Control1591 class GLUIAPI GLUI_EditText : public GLUI_Control 1580 1592 { 1581 1593 public: … … 1587 1599 int text_x_offset; 1588 1600 int substring_start; /*substring that gets displayed in box*/ 1589 int substring_end; 1601 int substring_end; 1590 1602 int sel_start, sel_end; /* current selection */ 1591 1603 int num_periods; … … 1646 1658 int id=-1, GLUI_CB callback=GLUI_CB() ); 1647 1659 // Constructor, char* live variable 1648 GLUI_EditText( GLUI_Node *parent, const char *name, 1660 GLUI_EditText( GLUI_Node *parent, const char *name, 1649 1661 char *live_var, 1650 1662 int id=-1, GLUI_CB callback=GLUI_CB() ); 1651 1663 // Constructor, std::string live variable 1652 GLUI_EditText( GLUI_Node *parent, const char *name, 1664 GLUI_EditText( GLUI_Node *parent, const char *name, 1653 1665 std::string &live_var, 1654 1666 int id=-1, GLUI_CB callback=GLUI_CB() ); … … 1684 1696 draw_text_only = false; 1685 1697 } 1686 void common_construct( GLUI_Node *parent, const char *name, 1698 void common_construct( GLUI_Node *parent, const char *name, 1687 1699 int data_type, int live_type, void *live_var, 1688 1700 int id, GLUI_CB callback ); … … 1695 1707 /************************************************************/ 1696 1708 1697 class GLUI _CommandLine : public GLUI_EditText1709 class GLUIAPI GLUI_CommandLine : public GLUI_EditText 1698 1710 { 1699 1711 public: … … 1701 1713 1702 1714 enum { HIST_SIZE = 100 }; 1715 1716 #ifdef _MSC_VER 1717 // Explicit template instantiation needed for dll 1718 template class GLUIAPI std::allocator<GLUI_String>; 1719 template class GLUIAPI std::vector<GLUI_String, std::allocator<GLUI_String> >; 1720 #endif 1721 1703 1722 std::vector<GLUI_String> hist_list; 1704 1723 int curr_hist; … … 1737 1756 commit_flag = false; 1738 1757 } 1758 1739 1759 }; 1740 1760 … … 1745 1765 /************************************************************/ 1746 1766 1747 class GLUI _RadioGroup : public GLUI_Control1767 class GLUIAPI GLUI_RadioGroup : public GLUI_Control 1748 1768 { 1749 1769 public: … … 1752 1772 void draw( int x, int y ); 1753 1773 void set_name( const char *text ); 1754 void set_int_val( int int_val ); 1774 void set_int_val( int int_val ); 1755 1775 void set_selected( int int_val ); 1756 1776 … … 1782 1802 /************************************************************/ 1783 1803 1784 class GLUI _RadioButton : public GLUI_Control1804 class GLUIAPI GLUI_RadioButton : public GLUI_Control 1785 1805 { 1786 1806 public: … … 1823 1843 /************************************************************/ 1824 1844 1825 class GLUI _Separator : public GLUI_Control1845 class GLUIAPI GLUI_Separator : public GLUI_Control 1826 1846 { 1827 1847 public: … … 1855 1875 /* */ 1856 1876 /************************************************************/ 1857 1858 class GLUI _Spinner : public GLUI_Control1877 1878 class GLUIAPI GLUI_Spinner : public GLUI_Control 1859 1879 { 1860 1880 public: 1861 1881 // Constructor, no live var 1862 GLUI_Spinner( GLUI_Node* parent, const char *name, 1882 GLUI_Spinner( GLUI_Node* parent, const char *name, 1863 1883 int data_type=GLUI_SPINNER_INT, int id=-1, GLUI_CB callback=GLUI_CB() ); 1864 1884 // Constructor, int live var 1865 GLUI_Spinner( GLUI_Node* parent, const char *name, 1885 GLUI_Spinner( GLUI_Node* parent, const char *name, 1866 1886 int *live_var, int id=-1, GLUI_CB callback=GLUI_CB() ); 1867 1887 // Constructor, float live var 1868 GLUI_Spinner( GLUI_Node* parent, const char *name, 1888 GLUI_Spinner( GLUI_Node* parent, const char *name, 1869 1889 float *live_var, int id=-1, GLUI_CB callback=GLUI_CB() ); 1870 1890 // Deprecated constructor 1871 GLUI_Spinner( GLUI_Node* parent, const char *name, 1891 GLUI_Spinner( GLUI_Node* parent, const char *name, 1872 1892 int data_type, 1873 1893 void *live_var, … … 1938 1958 user_speed = 1.0; 1939 1959 } 1940 void common_construct( GLUI_Node* parent, const char *name, 1960 void common_construct( GLUI_Node* parent, const char *name, 1941 1961 int data_type, void *live_var, 1942 1962 int id, GLUI_CB callback ); … … 1949 1969 /************************************************************/ 1950 1970 1951 class GLUI _StaticText : public GLUI_Control1971 class GLUIAPI GLUI_StaticText : public GLUI_Control 1952 1972 { 1953 1973 public: … … 1975 1995 /************************************************************/ 1976 1996 1977 class GLUI _TextBox : public GLUI_Control1997 class GLUIAPI GLUI_TextBox : public GLUI_Control 1978 1998 { 1979 1999 public: … … 1988 2008 int insertion_pt; 1989 2009 int substring_start; /*substring that gets displayed in box*/ 1990 int substring_end; 2010 int substring_end; 1991 2011 int sel_start, sel_end; /* current selection */ 1992 2012 int last_insertion_pt; … … 2008 2028 int key_handler( unsigned char key,int modifiers ); 2009 2029 int special_handler( int key,int modifiers ); 2010 2030 2011 2031 void activate( int how ); 2012 2032 void deactivate( void ); … … 2068 2088 } 2069 2089 void common_construct( 2070 GLUI_Node *parent, GLUI_String *live_var, 2071 bool scroll, int id, GLUI_CB callback); 2090 GLUI_Node *parent, GLUI_String *live_var, 2091 bool scroll, int id, GLUI_CB callback); 2072 2092 }; 2073 2093 … … 2078 2098 /************************************************************/ 2079 2099 2080 class GLUI _List_Item : public GLUI_Node2100 class GLUIAPI GLUI_List_Item : public GLUI_Node 2081 2101 { 2082 2102 public: … … 2091 2111 /************************************************************/ 2092 2112 2093 class GLUI _List : public GLUI_Control2113 class GLUIAPI GLUI_List : public GLUI_Control 2094 2114 { 2095 2115 public: … … 2097 2117 GLUI_List( GLUI_Node *parent, bool scroll = false, 2098 2118 int id=-1, GLUI_CB callback=GLUI_CB() ); 2099 /*, GLUI_Control *object = NULL 2119 /*, GLUI_Control *object = NULL 2100 2120 ,GLUI_InterObject_CB obj_cb = NULL);*/ 2101 2121 2102 2122 GLUI_List( GLUI_Node *parent, 2103 GLUI_String& live_var, bool scroll = false, 2104 int id=-1, 2123 GLUI_String& live_var, bool scroll = false, 2124 int id=-1, 2105 2125 GLUI_CB callback=GLUI_CB() 2106 2126 /*,GLUI_Control *object = NULL */ … … 2128 2148 int key_handler( unsigned char key,int modifiers ); 2129 2149 int special_handler( int key,int modifiers ); 2130 2150 2131 2151 void activate( int how ); 2132 2152 void deactivate( void ); … … 2197 2217 /* */ 2198 2218 /************************************************************/ 2199 2200 class GLUI _Scrollbar : public GLUI_Control2219 2220 class GLUIAPI GLUI_Scrollbar : public GLUI_Control 2201 2221 { 2202 2222 public: 2203 2223 // Constructor, no live var 2204 2224 GLUI_Scrollbar( GLUI_Node *parent, 2205 const char *name, 2225 const char *name, 2206 2226 int horz_vert=GLUI_SCROLL_HORIZONTAL, 2207 2227 int data_type=GLUI_SCROLL_INT, 2208 int id=-1, GLUI_CB callback=GLUI_CB() 2228 int id=-1, GLUI_CB callback=GLUI_CB() 2209 2229 /*,GLUI_Control *object = NULL*/ 2210 2230 /*,GLUI_InterObject_CB obj_cb = NULL*/ … … 2214 2234 GLUI_Scrollbar( GLUI_Node *parent, const char *name, int horz_vert, 2215 2235 int *live_var, 2216 int id=-1, GLUI_CB callback=GLUI_CB() 2236 int id=-1, GLUI_CB callback=GLUI_CB() 2217 2237 /*,GLUI_Control *object = NULL*/ 2218 2238 /*,GLUI_InterObject_CB obj_cb = NULL*/ … … 2248 2268 2249 2269 2250 /* Rather than directly access an Editbox or Textbox for 2270 /* Rather than directly access an Editbox or Textbox for 2251 2271 changing variables, a pointer to some object is defined 2252 2272 along with a static callback in the form func(void *, int) - … … 2262 2282 int key_handler( unsigned char key,int modifiers ); 2263 2283 int special_handler( int key,int modifiers ); 2264 2284 2265 2285 void draw( int x, int y ); 2266 2286 void draw_pressed( void ); … … 2293 2313 void common_construct( 2294 2314 GLUI_Node *parent, 2295 const char *name, 2315 const char *name, 2296 2316 int horz_vert, 2297 2317 int data_type, void* live_var, … … 2311 2331 /************************************************************/ 2312 2332 2313 class GLUI _Listbox_Item : public GLUI_Node2333 class GLUIAPI GLUI_Listbox_Item : public GLUI_Node 2314 2334 { 2315 2335 public: … … 2318 2338 }; 2319 2339 2320 class GLUI _Listbox : public GLUI_Control2340 class GLUIAPI GLUI_Listbox : public GLUI_Control 2321 2341 { 2322 2342 public: … … 2352 2372 GLUI_Listbox_Item *get_item_ptr( const char *text ); 2353 2373 GLUI_Listbox_Item *get_item_ptr( int id ); 2354 2374 2355 2375 2356 2376 GLUI_Listbox( GLUI_Node *parent, … … 2388 2408 This is the superclass of translation and rotation widgets. 2389 2409 */ 2390 class GLUI _Mouse_Interaction : public GLUI_Control2410 class GLUIAPI GLUI_Mouse_Interaction : public GLUI_Control 2391 2411 { 2392 2412 public: … … 2412 2432 virtual void iaction_dump( FILE *output )=0; 2413 2433 virtual void iaction_init( void ) = 0; 2414 2434 2415 2435 GLUI_Mouse_Interaction( void ) { 2416 2436 glui_format_str( name, "Mouse_Interaction: %p", this ); … … 2434 2454 a 3D rotation via a spaceball-like interface. 2435 2455 */ 2436 class GLUI _Rotation : public GLUI_Mouse_Interaction2456 class GLUIAPI GLUI_Rotation : public GLUI_Mouse_Interaction 2437 2457 { 2438 2458 public: … … 2441 2461 bool can_spin, spinning; 2442 2462 float damping; 2443 2463 2444 2464 int iaction_mouse_down_handler( int local_x, int local_y ); 2445 2465 int iaction_mouse_up_handler( int local_x, int local_y, bool inside ); … … 2489 2509 a 3D translation. 2490 2510 */ 2491 class GLUI _Translation : public GLUI_Mouse_Interaction2511 class GLUIAPI GLUI_Translation : public GLUI_Mouse_Interaction 2492 2512 { 2493 2513 public: … … 2513 2533 void setup_texture( void ); 2514 2534 void setup_lights( void ); 2515 void draw_2d_arrow( int radius, int filled, int orientation ); 2535 void draw_2d_arrow( int radius, int filled, int orientation ); 2516 2536 void draw_2d_x_arrows( int radius ); 2517 2537 void draw_2d_y_arrows( int radius ); … … 2565 2585 /* These are the callbacks that we pass to glut. They take 2566 2586 some action if necessary, then (possibly) call the user-level 2567 glut callbacks. 2587 glut callbacks. 2568 2588 */ 2569 2589 trunk/llmozlib2/tests/ubrowser/ubrowser.cpp
r11 r15 88 88 mIdNavHome( 0x0016 ), 89 89 mIdNavForward( 0x0017 ), 90 mIdNavReload( 0x001b ), 90 91 mIdBrowserSmall( 0x0018 ), 91 92 mIdBrowserMedium( 0x0019 ), 92 93 mIdBrowserLarge( 0x001a ), 93 mFocusUrlEdit( 0x001b ),94 94 mIdUpdateTypeRB( 0x0100 ), 95 95 mIdUpdateTypeG( 0x0101 ), … … 149 149 mBookmarks.push_back( std::pair< std::string, std::string >( "XUL Widgets", "http://www.hevanet.com/acorbin/xul/top.xul" ) ); 150 150 mBookmarks.push_back( std::pair< std::string, std::string >( "Yahoo! User Interface Library slider", "http://developer.yahoo.com/yui/examples/slider/rgb2.html?mode=dist" ) ); 151 mBookmarks.push_back( std::pair< std::string, std::string >( "Shared HTML based Whiteboard", "http://donovanpreston.com:8080/draw/" ) );152 151 mBookmarks.push_back( std::pair< std::string, std::string >( "Canvas Annimation Kit Experiment", "http://glimr.rubyforge.org/cake/canvas.html#DesignSketching" ) ); 153 152 mBookmarks.push_back( std::pair< std::string, std::string >( "Skrbl shared whiteboard (non-flash)", "http://skrbl.com" ) ); … … 792 791 793 792 mTopGLUIWindow->add_column( false ); 793 GLUI_Button* mNavReloadButton = mTopGLUIWindow->add_button( "Reload", mIdNavReload, gluiCallbackWrapper ); 794 mNavReloadButton->set_w( 56 ); 795 796 mTopGLUIWindow->add_column( false ); 794 797 #ifdef LL_NEWER_GLUI 795 798 mUrlEdit = mTopGLUIWindow->add_edittext( "Url:", GLUI_EDITTEXT_TEXT, mNavUrl, mIdUrlEdit, gluiCallbackWrapper ); … … 798 801 mUrlEdit = mTopGLUIWindow->add_edittext( "Url:", mNavUrl, mIdUrlEdit, gluiCallbackWrapper ); 799 802 #endif // LL_NEWER_GLUI 800 801 mTopGLUIWindow->add_column( false );802 mTopGLUIWindow->add_button( "Focus", mFocusUrlEdit, gluiCallbackWrapper );803 803 804 804 mTopGLUIWindow->set_main_gfx_window( mAppWindow ); … … 956 956 // this seems better than sending focus on mouse down (still need to improve this) 957 957 LLMozLib::getInstance()->focusBrowser( mCurWindowId, true ); 958 959 // turn off the URL edit widget so it's "obvious" that you need to press focus to reenable it.960 // (focus restriction in GLUI i wasn't able to work around)961 mUrlEdit->disable();962 958 }; 963 959 } … … 1113 1109 } 1114 1110 else 1111 if ( controlIdIn == mIdNavReload ) 1112 { 1113 LLMozLib::getInstance()->navigateReload( mCurWindowId ); 1114 } 1115 else 1115 1116 if ( controlIdIn == mIdUrlEdit ) 1116 1117 { … … 1121 1122 { 1122 1123 LLMozLib::getInstance()->navigateTo( mCurWindowId, mBookmarks[ mSelBookmark ].second.c_str() ); 1123 }1124 else1125 // silly hack needed to get around a limitation of GLUI (or myunderstanding of it).1126 // I really need a callback when caret enters the edit field so I can do this automatically1127 if ( controlIdIn == mFocusUrlEdit )1128 {1129 mUrlEdit->enable();1130 LLMozLib::getInstance()->focusBrowser( mCurWindowId, false );1131 setFocusNativeWindow();1132 1124 } 1133 1125 else trunk/llmozlib2/tests/ubrowser/ubrowser.h
r9 r15 151 151 const int mIdNavHome; 152 152 const int mIdNavForward; 153 const int mIdNavReload; 153 154 const int mIdBrowserSmall; 154 155 const int mIdBrowserMedium; 155 156 const int mIdBrowserLarge; 156 const int mFocusUrlEdit;157 157 const int mIdFace0; 158 158 const int mIdFace1;
