Page 1 of 2

Build 2.00.2307

Posted: Wed Dec 11, 2024 5:07 am
by Tom
Hi, there.

Build 2307 adds new hide/show methods to XbpColumn, maybe this is something that works better than the mechanisms using AddColumn/DelColumn.

Besides, there are several news around the PGDBE.

Re: Build 2.00.2307

Posted: Wed Dec 11, 2024 11:34 pm
by SlavkoDam
Hi,

I have described the best way to hide/show XbpColumn, in the following topic here. It is based on Alaska XbpBrowse and XbpColumn implementations. I suppose and believe that Alaska dev team saw my post and learned from it.

http://bb.donnay-software.com/Donnay/vi ... f=2&t=3211

Re: Build 2.00.2307

Posted: Thu Dec 12, 2024 1:07 am
by Tom
Hi.

This is how I (and, as I believe, lots of others) do it for years in my applications. I don't believe Alaska reimplemented that, because it has issues. I planned to test what they provided next week.

Re: Build 2.00.2307

Posted: Thu Dec 12, 2024 7:43 am
by rdonnay
Build 2307 adds new hide/show methods to XbpColumn, maybe this is something that works better than the mechanisms using AddColumn/DelColumn.
This is very interesting. Adding and deleting columns to show and hide was something I didn't like in eXpress++.

If this works well in build 2307, then I guess I will try it and make it conditional at runtime, based on build number.

I am also interested in any improvements to PGDBE.

I didn't receive any email announcement about this.

Re: Build 2.00.2307

Posted: Thu Dec 12, 2024 11:24 pm
by SlavkoDam
Hi,
I don't believe Alaska reimplemented that, because it has issues.
What issues does it has?

Re: Build 2.00.2307

Posted: Wed Dec 18, 2024 4:11 am
by SlavkoDam
As I said there are no issues and my solution works fine, you can ask Cris who uses it. And you and nobody else never did (developed) that in your applications.

Alaska solution is different than mine. They recreate the whole browse panel and reposition all remaining visible columns. They also allow to hide/show the left/right frozen columns. My solution reposition only the columns right of the hidden column, so its less time consuming and faster. I don't think that its useful to hide/show frozen columns, but it can be easy adopted for that.

Re: Build 2.00.2307

Posted: Wed Dec 18, 2024 4:26 am
by Tom
To me it looks like they're not rebuilding/repainting the complete browse, but only the part right from the to be shown/to be hidden column. The colcount remains the same, the hidden column object is still available and, for instance, returns it's values if you use GetCell() and other stuff. This is difference to the usage of DelColumn() and AddColumn() - the column is just hidden, but it's still there. We also have/had issues with the Add/Del-approach with style aspects and sometimes with fragments of the headings left there when repainting the browse - it took us a huge amount of time to get this going. The new methods don't seem to have any of those problems. Besides, we allowed to hide frozen columns aswell. Why not?

Re: Build 2.00.2307

Posted: Wed Dec 18, 2024 5:14 am
by SlavkoDam
I studied the new source code of XbpBrowse(), and hide/show columns works as I described. Since the left part columns from the hidden column remain their old positions, you don't have the effect on the screen that they are repositioned two. But since the whole browse panel (background) is recreated to fit the sizes of the remaining visible columns, all columns have to be set parent to the new browse panel and repositioned again, and the whole browse refreshed with the InvalidateRect() method. The same process is done for showing of hidden columns. There is no problem with this solution, only has to do work with all columns and their background. I think that my solution is more elegant.

Of course, frozen columns may be hidden, why not. This don't change much in the solution, only is the column scrollable or not.

Re: Build 2.00.2307

Posted: Wed Dec 18, 2024 11:20 am
by Tom
I think that my solution is more elegant.
Great!

Re: Build 2.00.2307

Posted: Thu Dec 19, 2024 9:50 am
by rdonnay
I see now how you knew about this but I didn't.

I don't use the Workbench with Xbase++.
I only run it occasionally to check for updates.
I found it on the update manager, but not on their website.
It works just fine, better than my HIDE clause logic in eXpress++.
I'm going to update my DC_XbpColumn() class to use this update when version >= 2307

Here is my test program:

Code: Select all

#INCLUDE "dcdialog.CH"
#INCLUDE "Directry.CH"

// This example shows how to use the new hide() and show() methods of XbpColumn class
// when using Xbase++ build 2307 or later.

FUNCTION Main()

LOCAL GetList[0], oBrowse, aDir, oSayColumns, lHideWriteDate := .f., ;
      lHideCreateDate := .f., lHideAccessdate := .f., ;
      oWriteDate, oCreateDate, oAccessDate

aDir := Directory()

@ 0,0 DCSAY '#columns:'
@ DCGUI_ROW, DCGUI_COL + 10 DCSAY {||IIF(Valtype(oBrowse)='O',oBrowse:colCount,0)} SIZE 10 ;
   FONT '10.Lucida Console' SAYOBJECT oSayColumns

@ 1,0 DCBROWSE oBrowse DATA aDir FONT '10.Lucida Console' SIZE 100,20 HEADLINES 2 FIT

DCBROWSECOL ELEMENT F_NAME HEADER 'File Name' WIDTH 20 PARENT oBrowse

DCBROWSECOL ELEMENT F_SIZE HEADER 'Size' WIDTH 10 PARENT oBrowse

DCBROWSECOL ELEMENT F_WRITE_DATE HEADER 'Write;Date' WIDTH 10 PARENT oBrowse ;
   OBJECT oWriteDate

DCBROWSECOL ELEMENT F_WRITE_TIME HEADER 'Write;Time' WIDTH 10 PARENT oBrowse

DCBROWSECOL ELEMENT F_ATTR HEADER 'Attr' WIDTH 5 PARENT oBrowse

DCBROWSECOL ELEMENT F_CREATION_DATE HEADER 'Creation;Date' WIDTH 10 PARENT oBrowse ;
  OBJECT oCreateDate

DCBROWSECOL ELEMENT F_CREATION_TIME HEADER 'Creation;Time' WIDTH 10 PARENT oBrowse

DCBROWSECOL ELEMENT F_ACCESS_DATE HEADER 'Access;Date' WIDTH 10 PARENT oBrowse ;
  OBJECT oAccessDate

DCBROWSECOL ELEMENT F_ACCESS_TIME HEADER 'Access;Time' WIDTH 10 PARENT oBrowse

@ 22,0 DCPUSHBUTTON CAPTION 'Toggle Write Date' SIZE 15,1.2 ;
        ACTION {||lHideWriteDate := !lHideWriteDate, ;
                  IIF(lHideWriteDate,oWriteDate:hide(),oWriteDate:show()), ;
                  oSayColumns:refresh()}

@ DCGUI_ROW, DCGUI_COL + 20 DCPUSHBUTTON CAPTION 'Toggle Create Date' SIZE 15,1.2 ;
        ACTION {||lHideCreateDate := !lHideCreateDate, ;
                  IIF(lHideCreateDate,oCreateDate:hide(),oCreateDate:show()), ;
                  oSayColumns:refresh()}

@ DCGUI_ROW, DCGUI_COL + 20 DCPUSHBUTTON CAPTION 'Toggle Access Date' SIZE 15,1.2 ;
        ACTION {||lHideAccessDate := !lHideAccessDate, ;
                  IIF(lHideAccessDate,oAccessDate:hide(),oAccessDate:show()), ;
                  oSayColumns:refresh()}

DCREAD GUI FIT TITLE 'Browse Column Hide/Show Test' ;
   EVAL {||oSayColumns:refresh()}

RETURN nil

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

PROC appsys ; return