Ignore:
Timestamp:
Jan 16, 2007, 8:32:50 PM (19 years ago)
Author:
cinc
Message:

Improvements to folders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/class_c/wpfolderwindow.c

    r191 r194  
    3636 *
    3737 */
     38#define METHOD_DEBUG
     39
    3840#include <os2.h>
    3941
     
    5254#include "wpfolderwindow.ih"
    5355#include "wpobject.h"
     56#include "exception.h"
    5457
    5558NOM_Scope PGtkWidget NOMLINK impl_WPFolderWindow_wpQueryContainerHandle(WPFolderWindow* nomSelf, CORBA_Environment *ev)
     
    100103fldr_handleButtonEvent (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
    101104{
    102   if(fldr_checkContextButton(event))
    103     {
    104       PWPFolderWindow pWindow;
    105       GtkTreePath* treePath;
    106 
    107       DosBeep(5000, 100);
    108       pWindow=(WPFolderWindow*)user_data;
    109 
    110       treePath=gtk_icon_view_get_path_at_pos(GTK_ICON_VIEW(widget), event->x, event->y );
    111       if(NULL==treePath)
    112         {
    113           /* Click on white space */
    114           WPFolder* wpFolder;
    115           wpFolder=(WPFolder*)WPFolderWindow_wpQueryWPObject(pWindow, NULLHANDLE);
    116           g_message("%s: %s", __FUNCTION__, wpFolder->mtab->nomClassName);
    117           WPObject_wpDisplayMenu((WPObject*)wpFolder, pWindow, NULL, MENU_OPENVIEWPOPUP, 0, NULL);
    118         }
    119       else
    120         {
    121           GtkTreeIter iter;
    122           GtkTreeModel* model;
    123           WPObject *wpObject;
    124           /* Click on an icon */
    125 
    126           g_message("%s: %s", __FUNCTION__, gtk_tree_path_to_string(treePath));
    127 
    128           model=gtk_icon_view_get_model(GTK_ICON_VIEW(widget));
    129           g_message("%s: model: %x", __FUNCTION__, (UINT)model);
    130 
    131           gtk_tree_model_get_iter(model , &iter, treePath);
    132 
    133           gtk_tree_model_get(model, &iter,
    134                              0, &wpObject,
    135                              -1);
    136           g_message("%s: %s", __FUNCTION__, wpObject->mtab->nomClassName);
    137           WPObject_wpDisplayMenu((WPObject*)wpObject, pWindow, NULL, MENU_OBJECTPOPUP, 0, NULL);
    138         }
    139     }
     105 
     106
     107  TRY(FLDR_BUTTONEVENT) {
     108    if(fldr_checkContextButton(event))
     109      {
     110        PWPFolderWindow pWindow;
     111        GtkTreePath* treePath;
     112        DosBeep(5000, 100);
     113        pWindow=(WPFolderWindow*)user_data;
     114        TST_OBJECT(pWindow);
     115        treePath=gtk_icon_view_get_path_at_pos(GTK_ICON_VIEW(widget), event->x, event->y );
     116        if(NULL==treePath)
     117          {
     118            /* Click on white space */
     119            WPFolder* wpFolder;
     120            wpFolder=(WPFolder*)WPFolderWindow_wpQueryWPObject(pWindow, NULLHANDLE);
     121            TST_OBJECT(wpFolder);
     122           
     123            if(nomIsObj(wpFolder))
     124              WPObject_wpDisplayMenu((WPObject*)wpFolder, pWindow, NULL, MENU_OPENVIEWPOPUP, 0, NULL);
     125            else
     126              g_message("%d %s: WPFolder object not valid!", __LINE__, __FUNCTION__);
     127          }
     128        else
     129          {
     130            GtkTreeIter iter;
     131            GtkTreeModel* model;
     132            WPObject *wpObject;
     133            /* Click on an icon */
     134           
     135            g_message("%s: %s", __FUNCTION__, gtk_tree_path_to_string(treePath));
     136           
     137            model=gtk_icon_view_get_model(GTK_ICON_VIEW(widget));
     138            g_message("%s: model: %x", __FUNCTION__, (UINT)model);
     139           
     140            gtk_tree_model_get_iter(model , &iter, treePath);           
     141            gtk_tree_model_get(model, &iter, 0, &wpObject, -1);
     142
     143            TST_OBJECT(wpObject);
     144
     145            if(nomIsObj(wpObject)){
     146              g_message("%s: %s calling wpDisplayMenu()", __FUNCTION__, wpObject->mtab->nomClassName);
     147              WPObject_wpDisplayMenu((WPObject*)wpObject, pWindow, NULL, MENU_OBJECTPOPUP, 0, NULL);
     148            }
     149            else
     150              g_message("%d %s: WPDataFile object not valid!", __LINE__, __FUNCTION__);
     151
     152          }
     153      }/* if() */
     154  }CATCH{   
     155    //LOUD;
     156    g_message("Line %d: Trap in %s", __LINE__, __FUNCTION__); 
     157  }  END_CATCH(FLDR_BUTTONEVENT);
     158
    140159  return FALSE;
    141160}
     
    210229  /* Create an icon view without model */
    211230  icon_view = gtk_icon_view_new ();
    212   WPFolderWindow_wpSetContainerHandle(nomSelf, icon_view, NULLHANDLE);
    213                                      
     231
    214232  /* Allow multiple selection in icon view */
    215233  gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
     
    239257                    G_CALLBACK (up_clicked), store);
    240258#endif
     259
     260  WPFolderWindow_wpSetContainerHandle(nomSelf, icon_view, NULLHANDLE);
     261
    241262  /* Add icon view as child to the scroll window created earlier */
    242263  gtk_container_add (GTK_CONTAINER (sw), icon_view);
Note: See TracChangeset for help on using the changeset viewer.