Changeset 127
- Timestamp:
- Nov 29, 2006, 9:17:22 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/Makefile
r111 r127 4 4 # due to some problems with libc<->EMX 5 5 6 include ./ make.inc6 include ./../make.inc 7 7 8 8 … … 20 20 21 21 #INC = ./include -I $(NOMPATH)/include -I $(NOMPATH)/class_h 22 INC = ./include -I ./class_h -I $(NOMPATH)/class_h -I $(NOMPATH)/include 22 INC = ./include -I ./class_h -I $(NOMPATH)/class_h -I $(NOMPATH)/include \ 23 -I $(GUITKPATH)/class_h -I $(GUITKPATH)/include 23 24 24 25 ADDLIBS = -l$(OBJDIR)/nobjtk -l$(OBJDIR)/voywp 25 CLASSDLLLIBS = -l$(OBJDIR)/nobjtk 26 CLASSDLLLIBS = -l$(OBJDIR)/nobjtk -l$(OBJDIR)/voyguitk 26 27 27 28 # Define objects to build -
trunk/desktop/class_c/wpfolder.c
r122 r127 63 63 #include "desktoptypes.h" 64 64 65 /* Gui stuff */ 66 #include "nomguitk.h" 67 #include "nomfolderwindow.h" 68 65 69 /* Enum for the folder store */ 66 70 enum … … 85 89 return store; 86 90 } 87 88 static void89 itemActivated (GtkIconView *icon_view,90 GtkTreePath *tree_path,91 gpointer user_data)92 {93 DosBeep(1500, 100);94 }95 96 /*97 Check if the right button click was within a certain time. That means98 the user released the button again within a short time period. On OS/299 a context menu will display after the user released the button not when100 the user pressed it.101 */102 #define CTXT_MENU_BUTTON_DELAY 250103 static gboolean104 fldr_checkContextButton(GdkEventButton *event)105 {106 static guint guiTime=0;107 108 /* Right mouse button */109 if (event->button != 3)110 return FALSE;111 112 /* Ignore double-clicks and triple-clicks */113 if(event->type == GDK_BUTTON_PRESS)114 guiTime=event->time;115 116 if(event->type == GDK_BUTTON_RELEASE)117 {118 if(event->time-guiTime<CTXT_MENU_BUTTON_DELAY)119 return TRUE;120 }121 122 return FALSE;123 }124 125 static gboolean126 fldr_handleButtonEvent (GtkWidget *widget, GdkEventButton *event, gpointer user_data)127 {128 if(fldr_checkContextButton(event))129 {130 DosBeep(5000, 100);131 /* This is the folder object not the object on which a click occured */132 WPObject *wpObject=(WPObject*)user_data;133 if(nomIsObj(wpObject)){134 nomPrintf("%s: %x->%s\n", __FUNCTION__, wpObject, wpObject->mtab->nomClassName);135 }136 #if 0137 if(!somIsObj(wpObject))138 return TRUE;139 140 /* ptlPopupPt is NULLHANDLE because GTK automatically pick a useful position for the popup141 menu. */142 _wpDisplayMenu(wpObject, NULLHANDLE, (HWND) widget, NULLHANDLE, 0, (ULONG) 0);143 return TRUE;144 #endif145 }146 147 return FALSE;148 }149 150 91 151 92 static BOOL … … 230 171 231 172 /* pszPath contains the fully qualified path (checked with WPS) */ 232 NOM_Scope CORBA_boolean NOMLINK impl_WPFolder_wpPopulate(WPFolder* nomSelf, const CORBA_unsigned_long ulReserved, const CORBA_char * pszPath, const CORBA_boolean fFoldersOnly, CORBA_Environment *ev) 173 NOM_Scope CORBA_boolean NOMLINK impl_WPFolder_wpPopulate(WPFolder* nomSelf, const CORBA_unsigned_long ulReserved, 174 const CORBA_char * pszPath, const CORBA_boolean fFoldersOnly, 175 CORBA_Environment *ev) 233 176 { 234 177 WPFolderData* nomThis=WPFolderGetData(nomSelf); … … 369 312 370 313 /* 371 This method creates the folder window it doesn't quer iesany files or creates314 This method creates the folder window it doesn't query any files or creates 372 315 models and stuff. 373 316 */ 374 317 NOM_Scope gpointer NOMLINK impl_WPFolder_wpCreateFolderWindow(WPFolder* nomSelf, CORBA_Environment *ev) 375 318 { 376 /* WPFolderData* nomThis=WPFolderGetData(nomSelf); */ 377 GtkWidget* window; 378 GtkWidget *vbox; 379 GtkWidget *sw; 380 GtkWidget *icon_view; 381 GtkWidget *tool_bar; 382 GtkToolItem *up_button; 319 NOMFolderWindow * nomFldrWindow; 383 320 PPRIVFOLDERDATA priv; 384 385 321 WPFolderData *nomThis = WPFolderGetData(nomSelf); 386 322 387 /* Folder toplevel window. */388 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);389 /* Set title */390 // gtk_window_set_title (GTK_WINDOW (window), gcPath);391 gtk_window_set_title (GTK_WINDOW (window), "");392 /* FIXME: Set default size of folder frame. Will later use a stored value */393 gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);394 395 vbox = gtk_vbox_new (FALSE, 0);396 gtk_container_add (GTK_CONTAINER (window), vbox);397 398 /* Create and pack the toolbar */399 tool_bar = gtk_toolbar_new ();400 gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0); /* Don't expand the toolbar vertically if sized */401 402 /* Parent button */403 up_button = gtk_tool_button_new_from_stock (GTK_STOCK_GO_UP);404 gtk_tool_item_set_is_important (up_button, TRUE);405 /* Disable button */406 gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE);407 /* Put it into the toolbar */408 gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1);409 410 sw = gtk_scrolled_window_new (NULL, NULL);411 /* Drawing style */412 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),413 GTK_SHADOW_ETCHED_IN);414 /* Show scrollbars only if necessary */415 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),416 GTK_POLICY_AUTOMATIC,417 GTK_POLICY_AUTOMATIC);418 /* Pack it into the vbox with size adjusting to the vbox */419 gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);420 /* Create an icon view without model */421 icon_view = gtk_icon_view_new ();422 /* Allow multiple selection in icon view */423 gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),424 GTK_SELECTION_MULTIPLE);425 /* Connect to the "item_activated" signal */426 g_signal_connect (icon_view, "item-activated",427 G_CALLBACK (itemActivated), nomSelf);428 /* This is for kb binding only */429 #if 0430 g_signal_connect (GTK_WIDGET(icon_view), "popup-menu",431 G_CALLBACK (fldr_cbPopupMenu), nomSelf);432 #endif433 /* Handle mouse buttons */434 g_signal_connect (GTK_WIDGET(icon_view), "button-press-event",435 G_CALLBACK (fldr_handleButtonEvent), nomSelf);436 g_signal_connect (GTK_WIDGET(icon_view), "button-release-event",437 G_CALLBACK (fldr_handleButtonEvent), nomSelf);438 439 #if 0440 /* Connect to the "clicked" signal of the "Up" tool button */441 g_signal_connect (up_button, "clicked",442 G_CALLBACK (up_clicked), store);443 #endif444 /* Add icon view as child to the scroll window created earlier */445 gtk_container_add (GTK_CONTAINER (sw), icon_view);446 323 priv=(PPRIVFOLDERDATA)_privFolderData; 447 priv->gtkIconView=icon_view; 448 449 gtk_widget_grab_focus (icon_view); 450 451 gtk_widget_show_all (window); 452 453 return window; 454 } 455 456 457 458 459 324 325 nomFldrWindow=NOMFolderWindowNew(); 326 327 #warning !!!!! This is only for testing !!!!! 328 priv->gtkIconView=NOMFolderWindow_getContainerHandle(nomFldrWindow, ev); 329 330 NOMFolderWindow_show(nomFldrWindow, ev); 331 332 return NOMFolderWindow_getWindowHandle(nomFldrWindow, ev);; 333 } 334 335 336 337 338 -
trunk/gui/class_c/nomfolderwindow.c
r126 r127 56 56 CORBA_Environment *ev) 57 57 { 58 /* NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf); */ 59 60 } 61 58 NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf); 59 60 _pgContainerHandle=pgWidget; 61 } 62 63 64 static void 65 itemActivated (GtkIconView *icon_view, 66 GtkTreePath *tree_path, 67 gpointer user_data) 68 { 69 DosBeep(1500, 100); 70 } 71 72 /* 73 Check if the right button click was within a certain time. That means 74 the user released the button again within a short time period. On OS/2 75 a context menu will display after the user released the button not when 76 the user pressed it. 77 */ 78 #define CTXT_MENU_BUTTON_DELAY 250 79 static gboolean 80 fldr_checkContextButton(GdkEventButton *event) 81 { 82 static guint guiTime=0; 83 84 /* Right mouse button */ 85 if (event->button != 3) 86 return FALSE; 87 88 /* Ignore double-clicks and triple-clicks */ 89 if(event->type == GDK_BUTTON_PRESS) 90 guiTime=event->time; 91 92 if(event->type == GDK_BUTTON_RELEASE) 93 { 94 if(event->time-guiTime<CTXT_MENU_BUTTON_DELAY) 95 return TRUE; 96 } 97 98 return FALSE; 99 } 100 101 static gboolean 102 fldr_handleButtonEvent (GtkWidget *widget, GdkEventButton *event, gpointer user_data) 103 { 104 if(fldr_checkContextButton(event)) 105 { 106 DosBeep(5000, 100); 107 #if 0 108 /* This is the folder object not the object on which a click occured */ 109 WPObject *wpObject=(WPObject*)user_data; 110 if(nomIsObj(wpObject)){ 111 nomPrintf("%s: %x->%s\n", __FUNCTION__, wpObject, wpObject->mtab->nomClassName); 112 } 113 114 if(!somIsObj(wpObject)) 115 return TRUE; 116 117 /* ptlPopupPt is NULLHANDLE because GTK automatically pick a useful position for the popup 118 menu. */ 119 _wpDisplayMenu(wpObject, NULLHANDLE, (HWND) widget, NULLHANDLE, 0, (ULONG) 0); 120 return TRUE; 121 #endif 122 } 123 124 return FALSE; 125 } 126 127 NOM_Scope void NOMLINK impl_NOMFolderWindow_nomInit(NOMFolderWindow* nomSelf, CORBA_Environment *ev) 128 { 129 GtkWidget* window; 130 GtkWidget *vbox; 131 GtkWidget *sw; 132 GtkWidget *icon_view; 133 GtkWidget *tool_bar; 134 GtkToolItem *up_button; 135 136 NOMFolderWindowData* nomThis=NOMFolderWindowGetData(nomSelf); 137 138 /* Let parents initialize */ 139 NOMFolderWindow_nomInit_parent((NOMObject*) nomSelf, ev); 140 141 /* Create a default (hidden) folder window */ 142 143 /* Folder toplevel window. */ 144 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); 145 /* Set title */ 146 // gtk_window_set_title (GTK_WINDOW (window), ""); 147 148 /* FIXME: Set default size of folder frame. Will later use a stored value */ 149 gtk_window_set_default_size (GTK_WINDOW (window), 650, 400); 150 151 vbox = gtk_vbox_new (FALSE, 0); 152 gtk_container_add (GTK_CONTAINER (window), vbox); 153 154 /* Create and pack the toolbar */ 155 tool_bar = gtk_toolbar_new (); 156 gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0); /* Don't expand the toolbar vertically if sized */ 157 158 /* Parent button */ 159 up_button = gtk_tool_button_new_from_stock (GTK_STOCK_GO_UP); 160 gtk_tool_item_set_is_important (up_button, TRUE); 161 /* Disable button */ 162 gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE); 163 /* Put it into the toolbar */ 164 gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1); 165 166 sw = gtk_scrolled_window_new (NULL, NULL); 167 /* Drawing style */ 168 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), 169 GTK_SHADOW_ETCHED_IN); 170 /* Show scrollbars only if necessary */ 171 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), 172 GTK_POLICY_AUTOMATIC, 173 GTK_POLICY_AUTOMATIC); 174 /* Pack it into the vbox with size adjusting to the vbox */ 175 gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0); 176 /* Create an icon view without model */ 177 icon_view = gtk_icon_view_new (); 178 _pgContainerHandle=icon_view; 179 180 /* Allow multiple selection in icon view */ 181 gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), 182 GTK_SELECTION_MULTIPLE); 183 /* Connect to the "item_activated" signal */ 184 g_signal_connect (icon_view, "item-activated", 185 G_CALLBACK (itemActivated), nomSelf); 186 /* This is for kb binding only */ 187 #if 0 188 g_signal_connect (GTK_WIDGET(icon_view), "popup-menu", 189 G_CALLBACK (fldr_cbPopupMenu), nomSelf); 190 #endif 191 /* Handle mouse buttons */ 192 g_signal_connect (GTK_WIDGET(icon_view), "button-press-event", 193 G_CALLBACK (fldr_handleButtonEvent), nomSelf); 194 g_signal_connect (GTK_WIDGET(icon_view), "button-release-event", 195 G_CALLBACK (fldr_handleButtonEvent), nomSelf); 196 197 #if 0 198 /* Connect to the "clicked" signal of the "Up" tool button */ 199 g_signal_connect (up_button, "clicked", 200 G_CALLBACK (up_clicked), store); 201 #endif 202 /* Add icon view as child to the scroll window created earlier */ 203 gtk_container_add (GTK_CONTAINER (sw), icon_view); 204 205 gtk_widget_grab_focus (icon_view); 206 NOMFolderWindow_setWindowHandle(nomSelf, window, NULLHANDLE); 207 /* Window is hidden here and must be shown by the caller */ 208 } 209 -
trunk/gui/class_c/nomwindow.c
r126 r127 59 59 NOM_Scope void NOMLINK impl_NOMWindow_setWindowHandle(NOMWindow* nomSelf, const PGtkWidget pgWidget, CORBA_Environment *ev) 60 60 { 61 /* NOMWindowData* nomThis=NOMWindowGetData(nomSelf); */ 61 NOMWindowData* nomThis=NOMWindowGetData(nomSelf); 62 62 63 _pgWindowHandle=pgWidget; 63 64 } 64 65 66 NOM_Scope void NOMLINK impl_NOMWindow_show(NOMWindow* nomSelf, CORBA_Environment *ev) 67 { 68 /* NOMWindowData* nomThis=NOMWindowGetData(nomSelf); */ 69 70 gtk_widget_show_all(NOMWindow_getWindowHandle(nomSelf, NULLHANDLE)); 71 } 72 73 NOM_Scope void NOMLINK impl_NOMWindow_hide(NOMWindow* nomSelf, CORBA_Environment *ev) 74 { 75 /* NOMWindowData* nomThis=NOMWindowGetData(nomSelf); */ 76 gtk_widget_hide(NOMWindow_getWindowHandle(nomSelf, NULLHANDLE)); 77 } 78 -
trunk/gui/exports.def
r125 r127 9 9 NOMWindowNewClass 10 10 11 _NOMFolderWindowClassData 12 _NOMFolderWindowCClassData 13 NOMFolderWindowNewClass -
trunk/gui/idl/nomfolderwindow.idl
r126 r127 45 45 void setContainerHandle(in PGtkWidget pgWidget); 46 46 47 NOMOVERRIDE(nomInit); 48 47 49 NOMINSTANCEVAR(PGtkWidget _pgContainerHandle); 48 50 }; -
trunk/gui/idl/nomwindow.idl
r126 r127 45 45 PGtkWidget getWindowHandle(); 46 46 void setWindowHandle(in PGtkWidget pgWidget); 47 47 void show(); 48 void hide(); 48 49 NOMINSTANCEVAR(PGtkWidget _pgWindowHandle); 49 50 }; -
trunk/make.inc
r122 r127 36 36 IDLCOMP = L:\svn-sources\nom\trunk\ORBit2-2.14.0\src\idl-compiler\.libs\orbit-idl-2.exe 37 37 NOMPATH = L:/svn-sources/nom/trunk/nom 38 GUITKPATH = L:/svn-sources/desktop/trunk/gui
Note:
See TracChangeset
for help on using the changeset viewer.