Changeset 246


Ignore:
Timestamp:
Mar 10, 2007, 6:49:44 PM (18 years ago)
Author:
cinc
Message:

Added new method wpConnectDefaultSignalHandlers() to WPFolderWindow.

Location:
trunk/desktop
Files:
2 edited

Legend:

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

    r244 r246  
    651651#endif
    652652
     653#if 0
    653654  /* Handle mouse buttons */
    654655  g_signal_connect (GTK_WIDGET(icon_view), "button-press-event",
     
    675676  gtk_drag_dest_set(GTK_WIDGET(icon_view), GTK_DEST_DEFAULT_ALL, targetEntries, 1,
    676677                      GDK_ACTION_DEFAULT|GDK_ACTION_LINK|GDK_ACTION_COPY|GDK_ACTION_MOVE);
    677 
     678#endif
    678679#if 0
    679680  /* Connect to the "clicked" signal of the "Up" tool button */
     
    682683#endif
    683684
     685  _wpConnectDefaultSignalHandlers(nomSelf, icon_view, NULLHANDLE);
    684686  WPFolderWindow_wpSetContainerHandle(nomSelf, icon_view, NULLHANDLE);
    685687
     
    696698}
    697699
    698 
     700NOM_Scope void NOMLINK impl_WPFolderWindow_wpConnectDefaultSignalHandlers(WPFolderWindow* nomSelf,
     701                                                                          const PGtkWidget pgWidget,
     702                                                                          CORBA_Environment *ev)
     703{
     704/* WPFolderWindowData* nomThis=WPFolderWindowGetData(nomSelf); */
     705
     706  /* Handle mouse buttons */
     707  g_signal_connect (GTK_WIDGET(pgWidget), "button-press-event",
     708                    G_CALLBACK (fldr_handleButtonEvent), nomSelf);
     709  g_signal_connect (GTK_WIDGET(pgWidget), "button-release-event",
     710                    G_CALLBACK (fldr_handleButtonEvent), nomSelf);
     711
     712  /* Handle folder DnD */
     713  g_signal_connect(GTK_WIDGET(pgWidget), "drag-begin",
     714                   G_CALLBACK(fldrWindowHandleDragBegin), nomSelf);
     715  g_signal_connect(GTK_WIDGET(pgWidget), "drag-motion",
     716                   G_CALLBACK(fldrWindowHandleDragMotion), nomSelf);
     717  g_signal_connect(GTK_WIDGET(pgWidget), "drag-drop",
     718                   G_CALLBACK(fldrWindowHandleDragDrop), nomSelf);
     719  g_signal_connect(GTK_WIDGET(pgWidget), "drag_data_received",
     720                   G_CALLBACK(fldrWindowHandleDragDataReceived), nomSelf);
     721  g_signal_connect(GTK_WIDGET(pgWidget), "drag_data_get",
     722                   G_CALLBACK(fldrWindowHandleDragDataGet), nomSelf);
     723
     724  /* Prepare drag and drop */
     725  gtk_drag_source_set(GTK_WIDGET(pgWidget), GDK_BUTTON3_MASK, targetEntries,
     726                      G_N_ELEMENTS(targetEntries),
     727                      GDK_ACTION_DEFAULT|GDK_ACTION_LINK|GDK_ACTION_COPY|GDK_ACTION_MOVE);
     728  gtk_drag_dest_set(GTK_WIDGET(pgWidget), GTK_DEST_DEFAULT_ALL, targetEntries, 1,
     729                      GDK_ACTION_DEFAULT|GDK_ACTION_LINK|GDK_ACTION_COPY|GDK_ACTION_MOVE);
     730
     731}
     732
  • trunk/desktop/idl/wpfolderwindow.idl

    r245 r246  
    5959
    6060    Default desktop window used by folders to show objects to the user.
     61    It's essential that the WPFolder owning the WPFolderWindow is set
     62    into the instance variable by using wpSetObject() a method inherited
     63    from WPWindow.
     64
     65    This class can be used as a base class for window classes which will
     66    be used for folder windows. When creating a new class override nomInit()
     67    and create your window. Be sure to have at least one container window as
     68    a child of the toplevel window which will hold the folders objects. Save
     69    the handle to this container using wpSetContainerHandle(). Default drag and
     70    drop behaviour for desktop objects can easily be added by calling
     71    wpConnectDefaultSignalHandlers() with the created container handle.
     72
     73    There is no limitation on the number of containers held by the toplevel
     74    window. Each of these containers can be drag and drop enabled for desktop
     75    objects.
     76
    6177
    6278 */
     
    6581  NOMCLASSVERSION(1, 0);
    6682
     83  /**
     84     Query the handle to the container holding the objects.
     85 
     86     \par How to override:
     87     This method is usually not overriden.
     88
     89     \sa wpSetContainerHandle()
     90   */
    6791  PGtkWidget wpQueryContainerHandle();
    68   void wpSetContainerHandle(in PGtkWidget pgWidget);   
    6992
     93  /**
     94     Set the container handle of this folder window into the instance variable.
     95
     96     \remarks Always use this method to save the handle to the folder container.
     97     While it's possible to write to the instance variable from within nomInit()
     98     (where the toplevel window is created with at least one container window as a
     99     child), using this methods gives subclasses the chance to alter the container
     100     by overriding this method.
     101
     102     \param pgWidget Handle to a container window (usually GtkIconView)
     103
     104     \sa wpQueryContainerHandle()
     105   */
     106  void wpSetContainerHandle(in PGtkWidget pgWidget);
     107
     108  /**
     109     Connect signal handlers with the given container which enable drag and drop
     110     of desktop objects and context menus.
     111
     112     \remarks Using this method every container window (don't confuse that with GtkContainer)
     113     can be enabled for drag and drop of desktop objects. Default context menu behaviour
     114     known by desktop object will be enabled, too. There's no limit on the number
     115     of containers in a folder window.
     116
     117     \par How to override:
     118     This method can be overriden if additional signal handlers should be connected to the
     119     container.
     120
     121     \param pgWidget Container window handle. This is for example an icon view.
     122
     123     \sa wpSetContainerHandle()
     124   */ 
     125  void wpConnectDefaultSignalHandlers(in PGtkWidget pgWidget);
     126
     127  /**
     128     Override which creates a toplevel window with a container for icons.
     129   */
    70130  NOMOVERRIDE(nomInit);
    71131
     132  /**
     133     This variable holds the container window handle (normaly a handle of a GtkIconView).
     134
     135     \sa wpSetContainerHandle(), wpQueryContainerHandle()
     136   */
    72137  NOMINSTANCEVAR(PGtkWidget pgContainerHandle);
    73138};
Note: See TracChangeset for help on using the changeset viewer.