bb.donnay-software.com

Donnay Software Web Forums
It is currently Sun Nov 17, 2019 6:23 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Problem with :moveColumn
PostPosted: Sun Oct 06, 2019 8:27 am 
Offline

Joined: Tue Feb 12, 2019 7:58 am
Posts: 5
Hi everyone...
I have a problem with moving column in a browse, I had working with 1.9 version without problem but when I build the project with 2.0 the colummns don't move the same way.
When I click right button in a column it shows a menu that permit to move this column to right or left, but if I click againg, the selected column is not the column I'm clicking...

I've tried the Express 2.0 sample and it works like mine, don't work popperly. Only work with the first time. I've tried to refreshing and forcestable but i doesn't woth either.

Any idea?

Thanks
Daniel


Function code in the EXP20 Sample:

STATIC FUNCTION BrowseMenu( oBrowse )

STATIC soMenu, soBrowse

LOCAL GetList[0], i

IF Valtype(soMenu) # 'O' .OR. soMenu:status()<=0 .OR. soBrowse # oBrowse

IF Valtype(soMenu) = 'O'
soMenu := nil
ENDIF

soBrowse := oBrowse

DCSUBMENU soMenu

DCMENUITEM 'Move Column &Left' PARENT soMenu ACTION {||soBrowse:moveColumn(-1)}
DCMENUITEM 'Move Column &Right' PARENT soMenu ACTION {||soBrowse:moveColumn(1)}
DCMENUITEM SEPARATOR PARENT soMenu
DCMENUITEM 'Restore Defaults' PARENT soMenu ACTION {||soBrowse:restoreDefaults()}

DCREAD GUI ;
PARENT oBrowse ;
EXIT

ENDIF

RETURN soMenu

* --------------

STATIC FUNCTION BrowseMenuBlock( oBrowse )

RETURN {|x,y,z,o|o := BrowseMenu( oBrowse ), ;
o:popup( nil, x, 1 , ;
XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN ) }


* -------------

PROC appsys ; RETURN


Top
 Profile  
 
PostPosted: Sun Oct 06, 2019 6:30 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4002
Location: Boise, Idaho USA
It may be your version of eXpress++ that is the problem.

The following code works for me:

Code:
#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL aDir, oBrowse, aHeadings, GetList[0], i, GetOptions

aDir := Directory()

aHeadings := { 'File;Name', ;
               'File;Size', ;
               'Date;Last;Write', ;
               'Time;Last;Write', ;
               'File;Attr', ;
               'Size;Extend;Attr', ;
               'Create;Date', ;
               'Create;Time', ;
               'Date;Last;Access', ;
               'Time;Last;Access' }

@ 0,0 DCSAY 'Click Right Button in a Column for menu' ;
      SAYSIZE 50 COLOR GRA_CLR_BLUE

@ 1,0 DCBROWSE oBrowse DATA aDir PRESENTATION DC_BrowPres() ;
      SIZE 40,20 FIT ;
      ID 'DIRECTORY_BROWSE' ;
      HEADLINES 3 ;
      RBSELECT ;
      RBDOWN BrowseMenuBlock(@oBrowse)

FOR i := 1 TO Len(aHeadings)
  DCBROWSECOL ELEMENT i HEADER aHeadings[i] ;
     WIDTH 6 PARENT oBrowse ;
     SORT _SortBlock(i,aDir)
NEXT

DCGETOPTIONS ;
   NOMINBUTTON ;
   NOMAXBUTTON ;
   AUTORESIZE ;
   BUTTONALIGN DCGUI_BUTTONALIGN_CENTER

DCREAD GUI ;
   FIT ;
   BUTTONS DCGUI_BUTTON_OK ;
   OPTIONS GetOptions ;
   TITLE 'Directory Browse' ;
   MODAL ;
   SETAPPWINDOW

RETURN nil

* -------------

STATIC FUNCTION _SortBlock( i, aDir )

RETURN {||ASort(aDir,,,{|a,b|a[1]<b[1]})}

* ----------------

STATIC FUNCTION BrowseMenu( oBrowse )

STATIC soMenu, soBrowse

LOCAL GetList[0], i

IF Valtype(soMenu) # 'O' .OR. soMenu:status()<=0 .OR. soBrowse # oBrowse

IF Valtype(soMenu) = 'O'
soMenu := nil
ENDIF

soBrowse := oBrowse

DCSUBMENU soMenu

DCMENUITEM 'Move Column &Left' PARENT soMenu ACTION {||soBrowse:moveColumn(-1)}
DCMENUITEM 'Move Column &Right' PARENT soMenu ACTION {||soBrowse:moveColumn(1)}
DCMENUITEM SEPARATOR PARENT soMenu
DCMENUITEM 'Restore Defaults' PARENT soMenu ACTION {||soBrowse:restoreDefaults()}

DCREAD GUI ;
PARENT oBrowse ;
EXIT

ENDIF

RETURN soMenu

* --------------

STATIC FUNCTION BrowseMenuBlock( oBrowse )

RETURN {|x,y,z,o|o := BrowseMenu( oBrowse ), ;
o:popup( nil, x, 1 , ;
XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN ) }


* -------------

PROC appsys ; RETURN

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group