can use SWITCH Control in XBROWSE ?

can use SWITCH Control in XBROWSE ?

Postby Jimmy » Tue May 16, 2023 4:53 am

hi,

when use o:EditSource() of XBROWSE i get a TSwitch() Object for Type "L"

Question : can i show TSwitch() "in" XBROWSE :?:

if yes, how :idea:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: can use SWITCH Control in XBROWSE ?

Postby nageswaragunupudi » Tue May 16, 2023 6:22 am

TSwitch is a control.
We can not have controls inside the xbrowse cells.
If we want to have the same appearance, the we need to make two bitmaps for ON position and OFF position, with the same appearance.
Then:
Code: Select all  Expand view

oCol:SetCheck( { hBitmapON, hBitmapOff }, .t. )
 
Regards

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

Re: can use SWITCH Control in XBROWSE ?

Postby Jimmy » Wed May 17, 2023 2:11 pm

hi,

thx for Answer

under HMG i can put any Control in a Cell of "GRID" (WC_LISTVIEW)
under Xbase++ i have use "DatePicker" in XbpBrowse() which is like XBROWSE

not sure about how it work with "GRID" but under Xbase++ i can create my "own" Column CLASS

Code: Select all  Expand view
CLASS DXE_DateColumn FROM XbpColumn

and also to CELL
Code: Select all  Expand view
CLASS DXE_DateCellGroup FROM XbpCellGroup


Image
so it should be possible using OOP under Fivewin to use a Control in a "CELL"
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: can use SWITCH Control in XBROWSE ?

Postby Jimmy » Mon May 29, 2023 5:45 pm

hi,

i did found c:\fwh\samples\testdtp.prg

it does have EDIT_DATE or EDIT_TIME as "nEditType" of Column
Image
there are
Code: Select all  Expand view
#define EDIT_NONE             0
#define EDIT_GET              1
#define EDIT_LISTBOX          2
#define EDIT_BUTTON           3
#define EDIT_GET_LISTBOX      4
#define EDIT_GET_BUTTON       5
#define EDIT_DATE             6
#define EDIT_TIME             7

i like to request EDIT_LOGIC
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: can use SWITCH Control in XBROWSE ?

Postby nageswaragunupudi » Tue May 30, 2023 12:24 am

i like to request EDIT_LOGIC

This is implemented as:
Code: Select all  Expand view
oCol:SetCheck( [aBmps], [lEdit], [aPrompts]


Parameters:
aBmps: Optional. Array or 2 or 3 bitmaps to be displayed when the value is .T., .F., nil. If omitted, xbrowse provides default bitmaps which look like checkboxes.

lEdit: Optional: Value .T. indicates that the column can be edited by the user. Pressing <space>,<enter> or double click toggles the logical value.

aPrompts: Optional: If specified, displays the prompt in addition to the bitmap.

Usage:
Most common: oCol:SetCheck( nil, .t. )
or
oCol:setCheck( { bmpOn, bmpOff, bmpNil }, .t., { "Married", "Single" } )

If the browse has more than one logical column, we can globally set for all logical columns by:
oBrw:SetChecks( ... )
Regards

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

Re: can use SWITCH Control in XBROWSE ?

Postby nageswaragunupudi » Tue May 30, 2023 1:10 am

create my "own" Column CLASS


Using our own column class:
Code: Select all  Expand view
CLASS TMyColumn FROM TXBrwColumn
//
ENDCLASS


Then
Code: Select all  Expand view
@ r,c XBROWSE <clauses> CLASS TMyColumn() <moreClauses>

or
Code: Select all  Expand view
@ r,c XBROWSE <clauses> CLASS { || TMyColumn() } <moreClauses>
Regards

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

Re: can use SWITCH Control in XBROWSE ?

Postby nageswaragunupudi » Tue May 30, 2023 1:13 am

Can also derive our own browse class from TXBrowse.

Code: Select all  Expand view
CLASS TMyBrowse FROM TXBrowse
//
DATA bColClass INIT { || TMyColumn() }
//
ENDCLASS


Then
Code: Select all  Expand view
@ r,c XBROWSE <clauses> CLASS TMyBrowse() <moreClauses>

or
Code: Select all  Expand view
@ r,c XBROWSE <clauses> CLASS { || TMyBrowse() }<moreClauses>
Regards

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

Re: can use SWITCH Control in XBROWSE ?

Postby Jimmy » Tue May 30, 2023 5:12 pm

hi,

thx for Answer

i will try it if i can implement SWITCH Control in own CLASS FROM
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests