Jump to content

Serge_G

Members
  • Content Count

    333
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Serge_G


  1. Well it's a subject I was working on 07/2019 but reworking those days for a tutorial (and future book perhaps)

    The trick is first to get the style used 

    var sb: TFMXObject; 
    begin
       if assigned(Scene) then
       begin
       if not Assigned(Scene.StyleBook) then
          sb := TStyleManager.ActiveStyleForScene(Scene)
        else
          sb := Scene.StyleBook.Style;

    then once got you can search the needed properties

    if assigned(sb) then
    begin
    // text color
    aFMXObj := TStyleContainer(aFMXObj).FindStyleResource('labelstyle');
     if Assigned(aFMXObj) then
          aFMXObj := TLayout(aFMXObj).FindStyleResource('Text');
     if Assigned(aFMXObj) then
          Memo1.lines.Add(AlphaColorToString(TText(aFMXObj).TextSettings.FontColor));
    
    end;

    but for button color, it's a bit harder, you have 2 cases

    • Background is a TRectangle;
    • Background is  StyleObject (selection in a bitmap). 

    Use the same scheme as exposed for text color (finding 'buttonstyle')  and then 'background'

    if background object is a TRectangle then you can access fill.color property (take care type could be also a gradient ...) 

    else (a FMXObject) I made a try here 


    (by the way you can get button's text color(s) also)

     

    Sorry if my links are for French readers.

     

    P.S. read a some .style files to understand the principles

    • Thanks 1

  2. I could not use Firedac to achieve this (as you try changing TFDPhysFBDriverLink)  , but by using IBDac or ZEOSDBO then I reached my goal was : use my android machine as a client to server Firebird.

    But deploying Firebird  x64 on Android  is tricky

    https://sourceforge.net/p/zeoslib/wiki/How to use Firebird 4.0 with Zeos on Android/

    ARM version seems to be easier, but compatible Delphi x64 ??? 

     

    Note : I don't check really the server embedded function, only connection to a server 

     

    @Dmitry Arefiev should Firedac  be possible one day ?


  3. And the question is ?
    I don't want to use you exe nor your db file so with only .fmx file (should be great to have .pas and .dpr) review question and if needed archive


  4. Hi,

    What about using onBeforeInsert event and put in it

    procedure TForm1.MyTableBeforeInsert(DataSet: TDataSet);
    begin
    Dataset.Cancel;
    end;
    Quote

    MyTable.RecNo = MyTable.RecordCount

    I am not fan of these two values


  5. To answer @gkobler


    On page 21 of RAD Studio 12 Feature Matrix 
     

    Quote

    Support for local databases, including Microsoft Access database, SQLite and MariaDB
    database, IBToGo / IBLite, InterBase on localhost, MySQL Embedded, MySQL Server
    on localhost, Advantage Database local engine, PostgreSQL on localhost, Firebird
    Embedded, Firebird on localhost

    There are no limitations noted for a "classic" usage of SQLite .
    But, I can't test Community version to answer @FrancM


  6. So, I have a look and test with 11.3 and 12.1 (entreprise) and no slow comportment found. So, for me, you got it.🙌

    You said you use which version, community ok but last one (which is now a 11.2 or 11.3 version don't remember exactly ) ?

    As I see in your code, the key is the  TControlList.FHeights I never found (for my discharge, I just deep dive in this component at the first occurrence and never run back in it)


  7. Thanks for the guru, but actually I am on holidays (let say I prefer this term  that a low activity scheme due to retirement 😉

    Sure, I will have a look to your project. TControlList variable row heights was in my lengthy to-do list when retired but, as I really prefer FMX TListview this to-do item was in the bottom 10.  

    • Like 1

  8. It's been a long time since I've looked into livebindings, outside database links and even, less in VCL being much more FMX 🙄

    So, this question caught my attention.

    My first idea "its a VCL fact", but, writing the same sample in FMX, I got the same point 3 behaviour.

    My second clue was to notify BindingList a change, in memory my firsts steps with livebindings 

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Checkbox1.Checked:=not Checkbox1.Checked;
    BindingsList1.Notify(Checkbox1,'checked');
    end;

    But, unsuccessfully. My guess, checkbox state is changed after the drawing ?

    For that sort of, unusual, thing I used a one record ProtypeBindSource component with a boolean field

    image.thumb.png.286c633241c2ba5b4d449ffe3de73573.png

     

    And this code
     

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    PrototypeBindSource1.DataGenerator.Fields.Items[0].SetTValue(not checkbox1.Checked);
    end;

     

    Project22.zip

×