can use SWITCH Control in XBROWSE ?

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

can use SWITCH Control in XBROWSE ?

Post by Jimmy »

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: can use SWITCH Control in XBROWSE ?

Post by nageswaragunupudi »

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

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

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: can use SWITCH Control in XBROWSE ?

Post by Jimmy »

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

CLASS DXE_DateColumn FROM XbpColumn
and also to CELL

Code: Select all | Expand

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: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: can use SWITCH Control in XBROWSE ?

Post by Jimmy »

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

#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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: can use SWITCH Control in XBROWSE ?

Post by nageswaragunupudi »

i like to request EDIT_LOGIC
This is implemented as:

Code: Select all | Expand

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: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: can use SWITCH Control in XBROWSE ?

Post by nageswaragunupudi »

create my "own" Column CLASS
Using our own column class:

Code: Select all | Expand

CLASS TMyColumn FROM TXBrwColumn
//
ENDCLASS
Then

Code: Select all | Expand

@ r,c XBROWSE <clauses> CLASS TMyColumn() <moreClauses>
or

Code: Select all | Expand

@ r,c XBROWSE <clauses> CLASS { || TMyColumn() } <moreClauses>
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: can use SWITCH Control in XBROWSE ?

Post by nageswaragunupudi »

Can also derive our own browse class from TXBrowse.

Code: Select all | Expand

CLASS TMyBrowse FROM TXBrowse
//
DATA bColClass INIT { || TMyColumn() }
//
ENDCLASS
Then

Code: Select all | Expand

@ r,c XBROWSE <clauses> CLASS TMyBrowse() <moreClauses>
or

Code: Select all | Expand

@ r,c XBROWSE <clauses> CLASS { || TMyBrowse() }<moreClauses>
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: can use SWITCH Control in XBROWSE ?

Post by Jimmy »

hi,

thx for Answer

i will try it if i can implement SWITCH Control in own CLASS FROM
greeting,
Jimmy
Post Reply