Jump to content

Serge_G

Members
  • Content Count

    84
  • Joined

  • Last visited

Everything posted by Serge_G

  1. Serge_G

    LiveBinding at runtime

    Hi, sorry for delay but if it is still in actuality here is how i make this with TBindGridLink.Create(Self) do begin ControlComponent := Grid1; SourceComponent := AdapterBindSource1; // Filling Grid ColumnExpressions.AddExpression; // adding a right filler with ColumnExpressions.AddExpression do // ColumnName = 'Code', ColumnIndex = 1 begin SourceMemberName := 'Code'; with FormatCellExpressions.AddExpression do begin ControlExpression := 'Data'; SourceExpression := 'Value'; end; end; // an so on for columns // MANDATORY TO NAVIGATE // Position (synchronisation entre la liste et la grille) with PosControlExpressions.AddExpression do begin ControlExpression := 'Selected'; SourceExpression := 'Math_Max(0,ItemIndex)'; end; with PosSourceExpressions.AddExpression do begin ControlExpression := 'Math_Max(0,Selected)'; SourceExpression := 'ItemIndex'; end; // Working on columns size with FormatControlExpressions.AddExpression do begin ControlExpression := 'Columns[0].width'; SourceExpression := '20'; end; with FormatControlExpressions.AddExpression do begin ControlExpression := 'Columns[1].width'; SourceExpression := '140'; end; // and so on ... end;
  2. Serge_G

    Components for XADES and PDF signature

    Hi, Try TMS Cryptography pack Even if tagged as VCL it works for me in FMX environment. Well I don't use Xades but Pades so I should be pleased to know if it works also for Xades TMS offer also 2 free tools a certificate generator and a Ades document signature program done with the cryptography pack. Note, the team who wrote the component (Bernard Roussely and Marion Candau) is very reactive
  3. Serge_G

    TListView multi selection?

    😤 Well, I follow the track with those selections in edit mode, and I am disappointed ! 2 black points with the checkbox 1- with the common appearance (ListItemChecked, and all same type appearance). It works but if you don't want the checkbox checked when the item is clicked in theory you have to use option ClickOnSelect of TGlyphObjectButtonObject but this option as no effect (note was working with XE4) 2- I try to do the same thing but with appearance I prefer, the TDynamicAppearance one. In this case the checkbox don't react One question to @sjordi which event did you use for your selection, OnItemClick or OnItemClickEx ?
  4. Serge_G

    TListView multi selection?

    I knew I can find a better solution not involving bitmaps in the datasource . Here is the new code procedure TForm1.ListView1UpdatingObjects(const Sender: TObject; const AItem: TListViewItem; var AHandled: Boolean); var AListItemBitmap : TListItemImage; AListItemText : TListItemText; AColor : TAlphaColor; i : Word; begin AListItemBitmap:=AItem.Objects.FindObjectT<TListItemImage>('Image2'); AListItemText:=AItem.Objects.FindObjectT<TListItemText>('Text1'); if Assigned(AListItemBitmap) then begin AListItemBitmap.OwnsBitmap:=True; // this is the trick AListItemBitmap.Bitmap:=TBitmap.Create(40,40); try AColor:=StringToAlphaColor(AListItemText.Text) except // certaines couleurs sont inconnues! i.e. monneygreen, ltgrey AColor:=TAlphaColorRec.Null; end; AListItemBitmap.Bitmap.Clear(Acolor); //:=ABitmap; end; {$ENDIF} end; See line 12. Icing on the cake freeing bitmaps created is not needed anymore ! Tested on Windows10 and Android, hope it works on OSX and iOS
  5. Serge_G

    TListView multi selection?

    Even if this workaround works 👍, for me it's not satisfactory. I don't understand why this bitmap creation does not work on mobile devices !
  6. Serge_G

    TListView multi selection?

    Damned ! As far as I remember I test these codes with Berlin version but not for mobile devices. I investigate, (check my old hard disk to remember my various tests) and found the problem but no solution yet. I was right it as to do with bitmap ! But I cheat a little . I don't know which source you use, hope it's the color demo one. Cheating : I add a bitmap to my Tprotypebindsource . I link this one to the image object of the list, doing that we don't need to create (and destroy) bitmaps. Finally I change my code procedure TForm1.ListView1UpdatingObjects(const Sender: TObject; const AItem: TListViewItem; var AHandled: Boolean); var AListItemBitmap : TListItemImage; AListItemText : TListItemText; AColor : TAlphaColor; begin AListItemBitmap:=AItem.Objects.FindObjectT<TListItemImage>('Image2'); AListItemText:=AItem.Objects.FindObjectT<TListItemText>('Text1'); if Assigned(AListItemBitmap) then begin // AListItemBitmap.Bitmap:=TBitmap.Create(40,40); try AColor:=StringToAlphaColor(AListItemText.Text) except // certaines couleurs sont inconnues! i.e. monneygreen, ltgrey AColor:=TAlphaColorRec.Null; end; AListItemBitmap.Bitmap.Clear(AColor); end; end; Don't forget to remove the onCloseQuery event And, as you can see, image attached, it works ! After this "ascertainment", I dug in the developpez.net forum and found this post i wrote. The goal is now to mix the two but how ?
  7. Serge_G

    TListView multi selection?

    Hum, here you touch a point "I am not a pear 😣" = "I don't have any Apple device (jealous)" so I could not check my code on these systems, I had to trust developpez.net technical correctors and some beta testers. None of them rise this behavior though ! Now, as far as I guess could be a problem with style, I ran in this problem when stylecollection have various entries. On another hand, I use a Bitmap (and I read somewhere Apple is not really fan of windows things) it's perhaps there a response
  8. Serge_G

    TListView multi selection?

    Using a list object (even an invisible one) is the easiest way but if you want to have a quick "SelectedItems.count" that's not the fastest way. Sleeping on my second option, using interface, I think it's the best one. Reviewing one Marco Cantu's lesson "Advanced Interface : Using Interfaces to Implement an Adapter Pattern" on Embarcadero Academy my opinion seems to be confirmed. // scheme interface ISelectedLstViewItems = Interface ['{A3A6DE5C-496B-4766-89FF-23F08EA5B329}'] function GetSelectedItems : TList<Integer>; procedure SetSelectedItem(Value : TList<Integer>); property SelectedItems : TList<Integer> read GetSelectedItems write SetSelectedItems; end; In my mind building an interface containing a SelectedItems as a TList<integer> and then overriding TListView as TListView = class(FMX.ListView.TListview, ISelectedLstViewItems) in another unit should do the trick. The only thing I don't know is "is it possible to use TagObject for the "link" ?" (even if it is a contraint) . Think I will test this with my SearchListViewInterface (for info you can follow my steps here) to sjordi "A quoi cela sert que Ducros il se décarcasse !"
  9. Serge_G

    TListView multi selection?

    I wrote various tutorials (and preparing some others) and blog post about TListView but in french you can read here https://serge-girard.developpez.com/ There are more than one solution to your goal 1- using a list object (i.e the color), yes it's one 2- using an interface to keep all items selected is another one you can use. I don't work on this part, currently working on customizing searching in TListView, but in my mind an interface should do the trick easily. Hum, seem a good subject if y have some times
×