Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15210

Modified Files:
        CHANGELOG TreeView.xs 
Log Message:
Allow Treeview::GetParent to return parent window if called with no arguements

Index: CHANGELOG
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** CHANGELOG   16 Jul 2007 19:26:23 -0000      1.124
--- CHANGELOG   16 Jul 2007 19:28:28 -0000      1.125
***************
*** 10,13 ****
--- 10,14 ----
      - GUI.pm - fix -prompt option to Textfield (Tracker: 1734697)
      - GUI.pm - remove constants from AcceptFiles() [Joseph Cordero]
+     - Treeview.xs - fix GetParent() method to get the parent window, rather
  
  + [Robert May] : 15 July 2007 -  Bug Fixes

Index: TreeView.xs
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/TreeView.xs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TreeView.xs 13 Apr 2006 22:17:07 -0000      1.8
--- TreeView.xs 16 Jul 2007 19:28:28 -0000      1.9
***************
*** 585,594 ****
      # (@)METHOD:GetParent(NODE)
      # Returns the handle of the parent node for the given B<NODE>.
  HTREEITEM
! GetParent(handle,item)
      HWND handle
      HTREEITEM item
  CODE:
!     RETVAL = TreeView_GetParent(handle, item);
  OUTPUT:
      RETVAL
--- 585,612 ----
      # (@)METHOD:GetParent(NODE)
      # Returns the handle of the parent node for the given B<NODE>.
+     #
+     # NOTE: With no B<NODE> parameter this is the standard
+     # L<GetParent()|Win32::GUI::Reference::Methods/GetParent>
+     # method, returning the parent window. 
  HTREEITEM
! GetParent(handle,item = NULL)
      HWND handle
      HTREEITEM item
  CODE:
!     if(items == 1) { /* NOTE this is the XS defined 'items' var, not 'item' */
!         SV   *SvParent;
!         HWND parentHandle = GetParent(handle);
! 
!         if (parentHandle && (SvParent = SV_SELF_FROM_WINDOW(parentHandle)) && 
SvROK(SvParent)) {
!             XPUSHs(SvParent);
!             XSRETURN(1);
!         }
!         else {
!             XSRETURN_UNDEF;
!         }
!     }
!     else {
!         RETVAL = TreeView_GetParent(handle, item);
!     }
  OUTPUT:
      RETVAL


Reply via email to