To nages : modify of a xbrowse

To nages : modify of a xbrowse

Postby Silvio.Falconi » Wed May 08, 2024 10:41 am

Nages,
I have this xbrowse with an array

Image


when I modify 4th column and the string is "45" i can insert only 2 space

how I can resolve ?

I made

Code: Select all  Expand view  RUN

WITH OBJECT oBrwFilter

      :bPastEof     := { ||  AddRow( oBrwFilter ) }
      :bKeyDown  := { |nKey| If( nKey == VK_DELETE, DeleteRow( oBrwFilter ), ;
                             If( nKey == VK_INSERT, InsertRow( oBrwFilter ), ;
                              nil ) ) }

               :aCols[1]:nEditType :=  EDIT_LISTBOX
               :aCols[1]:aEditListTxt := acOperators

               :aCols[2]:nEditType :=  EDIT_LISTBOX
               :aCols[2]:aEditListTxt := aTitulos

               :aCols[3]:nEditType :=  EDIT_LISTBOX
               :aCols[3]:aEditListTxt := acOpRelacion

               :aCols[4]:nEditType :=  EDIT_GET


      :lRecordSelector     := .f.
      :lHScroll             := .f.
      :lVScroll             := .f.
      :CreateFromCode()
   END


for the first column I wish it not show the listbox when is the first line of array

this not run

:aCols[1]:bEditBlock := { |r,c,oCol|IIF(!oBrwFilter:nArrayAt = 1, MsgInfo("Non puoi")) }


for the 4th column I have problem because I cannot insert more characters
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: To nages : modify of a xbrowse

Postby nageswaragunupudi » Wed May 08, 2024 2:22 pm

for the 4th column I have problem because I cannot insert more characters


Add this code:
Code: Select all  Expand view  RUN
oBrw:aCols[ 4 ]:nDataLen := n  // where n is the number of chars you want to enter


OR

Code: Select all  Expand view  RUN
oBrw:aCols[ 4 ]:lVarChar := .T.
// AND/OR
aCols[ 4 ]:nMaxLen := n
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: To nages : modify of a xbrowse

Postby Silvio.Falconi » Wed May 08, 2024 7:49 pm

nageswaragunupudi wrote:
for the 4th column I have problem because I cannot insert more characters


Add this code:
Code: Select all  Expand view  RUN
oBrw:aCols[ 4 ]:nDataLen := n  // where n is the number of chars you want to enter


OR

Code: Select all  Expand view  RUN
oBrw:aCols[ 4 ]:lVarChar := .T.
// AND/OR
aCols[ 4 ]:nMaxLen := n



Nages,
on first column I made

:aCols[1]:nEditType := EDIT_LISTBOX
:aCols[1]:aEditListTxt := acOperators
:aCols[1]:bEditBlock := { |r,c|IIF(oBrwFilter:nArrayAt = 1,MsgInfo("not"),) }


I not want the end use can select the combobox if is on first line ( SEE THE PICTURE)


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: To nages : modify of a xbrowse

Postby nageswaragunupudi » Thu May 09, 2024 3:41 pm

What is this?
Code: Select all  Expand view  RUN
:aCols[1]:bEditBlock := { |r,c|IIF(oBrwFilter:nArrayAt = 1,MsgInfo("not"),) }

What is the purpose of bEditBlock?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: To nages : modify of a xbrowse

Postby Silvio.Falconi » Thu May 09, 2024 8:20 pm

nageswaragunupudi wrote:What is this?
Code: Select all  Expand view  RUN
:aCols[1]:bEditBlock := { |r,c|IIF(oBrwFilter:nArrayAt = 1,MsgInfo("not"),) }

What is the purpose of bEditBlock?


I not Know I found this line on this forum

on first colum I use

:aCols[1]:nEditType := EDIT_LISTBOX
:aCols[1]:aEditListTxt := acOperators

I wish only it can run only when the oBrwFilter:nArrayAt not is 1 ( first row)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: To nages : modify of a xbrowse

Postby nageswaragunupudi » Mon May 13, 2024 5:03 am

Code: Select all  Expand view  RUN
oBrw:bEditWhen := { || oBrw:nArrayAt > 1 }

When the user is on line 1, he can open and see the list but can not change the value
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: To nages : modify of a xbrowse

Postby nageswaragunupudi » Mon May 13, 2024 6:28 am

Another way
Code: Select all  Expand view  RUN
oBrw:bChange := { |oBrw| XbrChange( oBrw ) }

//
//
//
function XbrChange( oBrw )

   if oBrw:nArrayAt == 1
      oBrw:aCols[ 1 ]:nEditType := 0
   else
      WITH OBJECT oBrw:aCols[ 1 ]
         :nEditType := EDIT_LISTBOX
         :aEditListTxt := acOperators
      END
   endif
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: To nages : modify of a xbrowse

Postby Silvio.Falconi » Mon May 13, 2024 7:05 am

nageswaragunupudi wrote:Another way
Code: Select all  Expand view  RUN
oBrw:bChange := { |oBrw| XbrChange( oBrw ) }

//
//
//
function XbrChange( oBrw )

   if oBrw:nArrayAt == 1
      oBrw:aCols[ 1 ]:nEditType := 0
   else
      WITH OBJECT oBrw:aCols[ 1 ]
         :nEditType := EDIT_LISTBOX
         :aEditListTxt := acOperators
      END
   endif
 



Nages,
Not run ok

Image

I can modify the first line and the first column
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: To nages : modify of a xbrowse

Postby nageswaragunupudi » Mon May 13, 2024 8:09 pm

Not run ok

Recheck your implementation.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests