How to make TFolderEx excel-like?

How to make TFolderEx excel-like?

Postby hua » Wed Nov 09, 2022 7:54 am

I was tasked to do the following:

i. Allow user to change tab names on the go similar to excel sheet. Right click, key-in new tab name and see it immediately reflected

ii. Have something similar to excel new sheet icon where on clicking it, a new folder would be added

Any pointers? TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby Jimmy » Wed Nov 09, 2022 8:40 am

hi hua,
hua wrote:i. Allow user to change tab names on the go similar to excel sheet. Right click, key-in new tab name and see it immediately reflected

Code: Select all  Expand view
METHOD RButtonDown( nRow, nCol, nFlags ) CLASS TFolderEx
...
      if ::bRClicked != nil
         Eval( ::bRClicked, nRow, nCol, nFlags, Self )

so what is your Problem :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to make TFolderEx excel-like?

Postby hua » Thu Nov 10, 2022 2:23 am

Getting the new name is the easy part. But what method to call to change the Tab's name?

Image
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby cnavarro » Thu Nov 10, 2022 4:42 am

Try with
Code: Select all  Expand view

   // n := oFld:nOption
   oFld:aPrompts[ n ] := "New Name"
   //oFld:Default()
   oFld:Refresh()
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to make TFolderEx excel-like?

Postby Jimmy » Thu Nov 10, 2022 6:24 am

hi,

i have this to change "Name of TAB"
Code: Select all  Expand view
  aPrompts := ACLONE( oTab:aPrompts )
   aPrompts[ nDim ] := aToken[ LEN( aToken ) - 1 ]  // Name of Folder
   oTab:SetPrompts( aPrompts )

Image
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: How to make TFolderEx excel-like?

Postby hua » Thu Nov 10, 2022 7:01 am

Thanks Cristobal, it works.
However is it possible to adjust the tab width automatically to accommodate long name?
Thank you

cnavarro wrote:Try with
Code: Select all  Expand view

   // n := oFld:nOption
   oFld:aPrompts[ n ] := "New Name"
   //oFld:Default()
   oFld:Refresh()
 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby hua » Thu Nov 10, 2022 7:02 am

Thank Jimmy.
:setPrompts() is only available if using TFolder class. I am using TFolderEx

Jimmy wrote:i have this to change "Name of TAB"
Code: Select all  Expand view
  aPrompts := ACLONE( oTab:aPrompts )
   aPrompts[ nDim ] := aToken[ LEN( aToken ) - 1 ]  // Name of Folder
   oTab:SetPrompts( aPrompts )

FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby Antonio Linares » Thu Nov 10, 2022 7:16 am

Dear Hua,

Please check DATA aSizes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to make TFolderEx excel-like?

Postby hua » Thu Nov 10, 2022 7:46 am

Thanks for the tip Antonio.

How to be able to right-click on a TTitle and change the text Antonio? Would it be possible?
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby Antonio Linares » Thu Nov 10, 2022 8:49 am

Try this:

oTitle:aText[ 3 ] = "new text"
oTitle:Refresh()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to make TFolderEx excel-like?

Postby cnavarro » Thu Nov 10, 2022 11:55 am

hua wrote:Thanks Cristobal, it works.
However is it possible to adjust the tab width automatically to accommodate long name?
Thank you

cnavarro wrote:Try with
Code: Select all  Expand view

   // n := oFld:nOption
   oFld:aPrompts[ n ] := "New Name"
   //oFld:Default()
   oFld:Refresh()
 


Please, for this, call method oFld:Default(), and try
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to make TFolderEx excel-like?

Postby hua » Mon Nov 14, 2022 10:38 am

Thanks Cristobal. I'll give it a try.

cnavarro wrote:
hua wrote:Thanks Cristobal, it works.
However is it possible to adjust the tab width automatically to accommodate long name?
Thank you

cnavarro wrote:Try with
Code: Select all  Expand view

   // n := oFld:nOption
   oFld:aPrompts[ n ] := "New Name"
   //oFld:Default()
   oFld:Refresh()
 


Please, for this, call method oFld:Default(), and try
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby hua » Mon Nov 14, 2022 10:39 am

Thanks Antonio. This works!
Anything similar for images created using TITLEIMG?

Antonio Linares wrote:Try this:

oTitle:aText[ 3 ] = "new text"
oTitle:Refresh()
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to make TFolderEx excel-like?

Postby Antonio Linares » Mon Nov 14, 2022 11:24 am

Dear Hua,

Do you mean to replace the image ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to make TFolderEx excel-like?

Postby hua » Tue Nov 15, 2022 2:17 am

Yes. To allow user to choose other image to replace the current one being displayed.
Thanks.

Antonio Linares wrote:Do you mean to replace the image ?
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Otto and 29 guests