FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour can use SWITCH Control in XBROWSE ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
can use SWITCH Control in XBROWSE ?
Posted: Tue May 16, 2023 04: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Tue May 16, 2023 06: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 (fw): Select all Collapse
oCol:SetCheck( { hBitmapON, hBitmapOff }, .t. )
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Wed May 17, 2023 02: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 (fw): Select all Collapse
CLASS DXE_DateColumn FROM XbpColumn
and also to CELL
Code (fw): Select all Collapse
CLASS DXE_DateCellGroup FROM XbpCellGroup

so it should be possible using OOP under Fivewin to use a Control in a "CELL"
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Mon May 29, 2023 05:45 PM
hi,

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

it does have EDIT_DATE or EDIT_TIME as "nEditType" of Column

there are
Code (fw): Select all Collapse
#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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Tue May 30, 2023 12:24 AM
i like to request EDIT_LOGIC
This is implemented as:
Code (fw): Select all Collapse
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Tue May 30, 2023 01:10 AM
create my "own" Column CLASS
Using our own column class:
Code (fw): Select all Collapse
CLASS TMyColumn FROM TXBrwColumn
//
ENDCLASS
Then
Code (fw): Select all Collapse
@ r,c XBROWSE <clauses> CLASS TMyColumn() <moreClauses>
or
Code (fw): Select all Collapse
@ r,c XBROWSE <clauses> CLASS { || TMyColumn() } <moreClauses>
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Tue May 30, 2023 01:13 AM
Can also derive our own browse class from TXBrowse.
Code (fw): Select all Collapse
CLASS TMyBrowse FROM TXBrowse
//
DATA bColClass INIT { || TMyColumn() }
//
ENDCLASS
Then
Code (fw): Select all Collapse
@ r,c XBROWSE <clauses> CLASS TMyBrowse() <moreClauses>
or
Code (fw): Select all Collapse
@ r,c XBROWSE <clauses> CLASS { || TMyBrowse() }<moreClauses>
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: can use SWITCH Control in XBROWSE ?
Posted: Tue May 30, 2023 05:12 PM

hi,

thx for Answer

i will try it if i can implement SWITCH Control in own CLASS FROM

greeting,

Jimmy

Continue the discussion