Page 1 of 5

Click in CheckBrowse to Select/Unselect

Posted: Mon May 08, 2017 8:39 am
by Eugene Lutsenko
Roger!

And there is a similar example works with the database?

Code: Select all

FUNCTION XSample_175()

/*
This sample shows how to use checkbox bitmaps
to provide the ability to check and uncheck
items in a browse.
*/

LOCAL GetList[0], oBrowse, aDir, n := 1, GetOptions

aDir := Directory()
FOR n := 1 TO Len(aDir)
  AAdd(aDir[n],.f.)
NEXT

n := 1

@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 80,12 ;
      PRESENTATION DC_BrowPres() FIT ;
      POINTER n ;
      MARK 11

DCBROWSECOL DATA {|x|x:=DC_GetColArray(11,oBrowse), ;
      IIF(x,BITMAP_CHECKBOX_CHECKED_S,BITMAP_CHECKBOX_UNCHECKED_S)} ;
      PARENT oBrowse HEADER 'Sel' WIDTH 1 ;
      TYPE XBPCOL_TYPE_BITMAP ;
      EVAL {|oB|oB:dataArea:lbClick := {|a,b,o|IIF(oBrowse:colPos=1,(aDir[n,11]:=!aDir[n,11],oBrowse:refreshCurrent()),nil)}}

DCBROWSECOL ELEMENT 1 PARENT oBrowse HEADER 'Name' WIDTH 10
DCBROWSECOL ELEMENT 2 PARENT oBrowse HEADER 'Size' WIDTH 8
DCBROWSECOL ELEMENT 3 PARENT oBrowse HEADER 'Date' WIDTH 8
DCBROWSECOL ELEMENT 4 PARENT oBrowse HEADER 'Time' WIDTH 8

DCGETOPTIONS AUTORESIZE

DCREAD GUI FIT ADDBUTTONS MODAL ;
     OPTIONS GetOptions ;
     TITLE 'Click in CheckBox to Select/Unselect'

RETURN aDir
*** END OF EXAMPLE ***

Re: Click in CheckBrowse to Select/Unselect

Posted: Mon May 08, 2017 9:03 am
by rdonnay
And there is a similar example works with the database?
It will require a logical field in the database to toggle. Do you have that?

Re: Click in CheckBrowse to Select/Unselect

Posted: Mon May 08, 2017 8:10 pm
by Eugene Lutsenko
Hey, Roger!

If necessary - do

Re: Click in CheckBrowse to Select/Unselect

Posted: Wed May 10, 2017 7:19 am
by Eugene Lutsenko
rdonnay wrote:
And there is a similar example works with the database?
It will require a logical field in the database to toggle. Do you have that?
Hey, Roger!

And show an example with the database?

And is it possible to make the field headings in this column with radio buttons you can remove or set the value of all switches base?

Re: Click in CheckBrowse to Select/Unselect

Posted: Wed May 10, 2017 6:46 pm
by rdonnay
I will give you a sample tomorrow or Friday.

Re: Click in CheckBrowse to Select/Unselect

Posted: Wed May 10, 2017 8:49 pm
by Eugene Lutsenko
rdonnay wrote:I will give you a sample tomorrow or Friday.
Thank you! I just did the mode in which it was going to use. It worked very well. But after your help it will be even better!!! In the same mode displays the Pareto subset of nonlocal neural network. And for selecting these subsets is used a lot of different ways to select this subset from the original set. And this, based on the mark records, not yet used.

Re: Click in CheckBrowse to Select/Unselect

Posted: Thu May 11, 2017 7:35 pm
by Eugene Lutsenko
Roger!

Given in the beginning of the topic, your example is an example of shows how to use checkbox bitmaps
to provide the ability to check and uncheck items in a browse (not an alternative choice).

Is it possible to obtain similar examples with database fields, similar to a radio and just the button? Radio can also be a Boolean field (an alternative choice), and the button calls editor memo field or a custom processing function. It was extremely cool!

In my system (Aidos) users can write applications to the cloud and read them from the cloud. Cloud is on my website. It does not require any programming. Therefore, users can the system share applications and work experience. While reading the applications they now see this screen (see picture): And I would like to do, so they can choose the Aidos-application to radio-select and talk about a specific application with me or each other by clicking on the corresponding button (which are not). I have already faced such a necessity.

Re: Click in CheckBrowse to Select/Unselect

Posted: Thu May 11, 2017 8:42 pm
by Auge_Ohr
Eugene Lutsenko wrote:Is it possible to obtain similar examples with database fields, similar to a radio and just the button? Radio can also be a Boolean field (an alternative choice), and the button calls editor memo field or a custom processing function. It was extremely cool!
as i understood

Code: Select all

DCBROWSECOL DATA {|x|x:=DC_GetColArray(11,oBrowse), ;
      IIF(x,BITMAP_CHECKBOX_CHECKED_S,BITMAP_CHECKBOX_UNCHECKED_S)} ;
it is just a Bitmap for a logic Field, not a Control "in" a Browse.

while you ask for MLE have a look for \SOURCE\samples\solution\xbpget\mlecol.prg

Code: Select all

CLASS XbpMleColumn FROM XbpGetColumn
so what you ask is a new Control

Code: Select all

CLASS MyRadioColumn FROM XbpColumn()
p.s. Wonder why you ask for Radiobutton in a Column (Cell)

Re: Click in CheckBrowse to Select/Unselect

Posted: Thu May 11, 2017 9:43 pm
by Eugene Lutsenko
Jimmy!

I can't see an example \SOURCE\samples\solution\xbpget\mlecol.prg, because I have 1.9.

If you say in General, that's all I need to control the Aidos-applications and discussion in the cloud. Specifically, I sort of tried to describe as best he could in his broken English. In Russian I still understand it and can articulate quite clearly, but in English it is clear I can not say. In addition to the classes I didn't really understand and actually can't use your advice. I was able to use them I still need to chew on the working examples. If you ask your questions more clear to me, I will try to answer

Re: Click in CheckBrowse to Select/Unselect

Posted: Fri May 12, 2017 9:29 am
by Auge_Ohr
Eugene Lutsenko wrote:I can't see an example \SOURCE\samples\solution\xbpget\mlecol.prg, because I have 1.9.
this is the Path to v1.9x Sample !

Code: Select all

c:\ALASKA\XPPW32\SOURCE\samples\solution\xbpget\mlecol.prg
as i say :
1.) you have to build a new CLASS
2.) you have to implement it into Express++

about Radiobutton : i wonder why you want a Radiobutton "in" a Browse Cell ?
Radiobutton can be 1 of "n" ... but you just have 1 Cell / Row so how to use it ?