Serge Girard

Member since: Thursday, 23 April 2015
Last login: 7 days ago
Profile viewed: 495 views

Your Rank: 93
Points: 1

Serge Girard replied to the topic 'Firemonkey Label not have transparent background' in the forum. 4 weeks ago

OK, there are still bugs with firemonkey especially using styles. But except particular case i discuss on this forum i do not have any problems with TLabel.
By instance did you know there is also a TText component not style related

Read More...

Serge Girard replied to the topic 'Rotating Timage' in the forum. 1 month ago

Hi,
You need to be more explicit ! It's so easy to do with FMX (just changing rotation properties) that i assume you want the how to in VCL framework ?

Read More...

Serge Girard replied to the topic 'FireDac - IndexName & SetRange' in the forum. 2 months ago

Hello,
I am afraid but not 100% you misunderstood firedac indexName property.
Firedac IndexName does not refer to any INDEX you built in database but "internal" index you create in your program, using indexes creation in dfm, AddIndex() function ...

Read More...

Serge Girard replied to the topic 'FMX - esthetic problem with sort of docking form' in the forum. 2 months ago

I change my animation working on Scale.X property and set property autoreverse to true

the code bloc is now

AniScaleX.StartValue:=TScaledLayout(AParent).Scale.X;
  AniScaleX.StopValue:=TScaledLaYout(AParent).Scale.X+0.01;
  AniScaleX.Start;
  AniScaleX.Start;
This works even if i still think it's a dirty solution

Read More...

Serge Girard replied to the topic 'Livebinding with database, what are notable use cases?' in the forum. 2 months ago

Hello

is there any tutorial for that?

I wrote 2 tutorials about (in french but there is a translator motor)
Generalities
Grids

Read More...

Serge Girard replied to the topic 'FMX - esthetic problem with sort of docking form' in the forum. 2 months ago

I wrote a very very dirty animation

procedure TMainForm.EmbeddedForm(AParent: TControl; AForm: TCustomForm);
var AControl : TFMXObject;
begin
 AParent.DeleteChildren;
 if Assigned(CurrentForm) then CurrentForm.Free;
// AParent.AddObject(TLayout(AForm.Children[0]));
//alternative
 AForm.Children[0].Parent:=AParent;
 CurrentForm:=AForm;  // mémoriser
 FloatAnimation1.Inverse:=False;
 FloatAnimation1.Start;
 FloatAnimation1.Inverse:=true;
 FloatAnimation1.Start;
FloatAnimation is attached to TScaledLayout rotation property
object MainLayout: TScaledLayout
    Align = Client
    OriginalWidth = 618.000000000000000000
    OriginalHeight = 387.000000000000000000
    Margins.Left = 10.000000000000000000
    Margins.Top = 10.000000000000000000
    Margins.Right = 10.000000000000000000
    Margins.Bottom = 10.000000000000000000
    Size.Width = 618.000000000000000000
    Size.Height = 387.000000000000000000
    Size.PlatformDefault = False
    object WarfLayout: TLayout
      Align = Client
      Margins.Left = 10.000000000000000000
      Margins.Top = 10.000000000000000000
      Margins.Right = 10.000000000000000000
      Margins.Bottom = 10.000000000000000000
      Size.Width = 598.000000000000000000
      Size.Height = 367.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 0
    end
    object FloatAnimation1: TFloatAnimation
      AnimationType = InOut
      Duration = 0.001000000047497451
      PropertyName = 'RotationAngle'
      StartValue = 0.000000000000000000
      StartFromCurrent = True
      StopValue = 1.000000000000000000
    end
  end
As i wrote, very dirty but worky trick, forcing the "refresh" , the goal !
There is certainly a best way :-) (at least a more clean one)

Read More...

Serge Girard replied to the topic 'FMX - esthetic problem with sort of docking form' in the forum. 2 months ago

Yes, that is my "little" problem.

Before my first question I had test the repaint, invalidaterect (problem is which Rect) even resizing the form but none with satisfaction :-( I think also about changing scale property but not test yet.

Thanks for the link Delphi Haven (i missed this one)
and will be glad if Remy enlight us

Serge

Read More...

Serge Girard replied to the topic 'FMX - esthetic problem with sort of docking form' in the forum. 2 months ago

Hello,

I don't understand why my attachments are not appearing perhaps i'm misunderstanding the tools usage.

Your sources are in the same idea, You are right in with an lightly different approach.

Now, test these steps :

  1. First add a Tlabel to your second form
  2. Click btnCallFormSecondForm
  3. Resize Main Form
  4. Click btCloseFormInRightSize
  5. Click btnCallFormSecondForm
And you will see my (in)esthetic problem :-( , Label text is sort of sourrounded

Read More...

Serge Girard created a new topic ' FMX - esthetic problem with sort of docking form' in the forum. 2 months ago

Hello
I am using sort of docking form.
In main main form i have a TScaledLayout where i "dock" a TLayout of another form(s) as i found somewhere in the doc

procedure TMainForm.EmbeddedForm(AParent: TControl; AForm: TCustomForm);
var AControl : TFMXObject;
begin
 AParent.DeleteChildren;
 if Assigned(CurrentForm) then CurrentForm.Free;
// while AForm.ChildrenCount>0 do
 AForm.Children[0].Parent:=AParent;
 CurrentForm:=AForm;  // mémoriser
end;
Some controls don't draw correctly (except after resizing) i.e. TLabels are shape surrounded (see Picture)
I attach also a little project if you want to test by yourself.

Question : how can i override this/these unwanted effects ? where is my mistake if any ?

N.B. the only docking ok is Layout to Layout

Read More...

Serge Girard replied to the topic 'TFDQuery not updating fields' in the forum. 2 months ago

I added a colum nto my SQLite table

Ok but how did you do that ?

it does not show up in the results of the query.
Once more, how do you show the result ? in a grid ? and if so have you declare the dataset fields of the fdQuery or not ? in the first case only the declared fields are shown (VCL program and DBGrid else if it's a FMX one hum it's a bit more complex i am afraid of)



Read More...

Serge Girard replied to the topic 'Cannot connect firebird with dbexpress or firedac' in the forum. 3 months ago

Hello,

IMHO it's an Firebird install problem, did you start-it as service ?
If not you'll need to start firebird before testing connections (ISQL works because it use an embedded version of firebird).

Read More...

Responding to myself !

I understood that TGrid don't behave like TStringGrid, don't memorize the cells value.
I found in the , poor, documentation that it was needed to do it manually in a TArray during the OnSetValue event, except that, if you use livebindings you can't !

So here is my tip :
I add a TStringGrid, invisible, filled before my grid in the BindingsList . The stringgrid need just one column (in my case) to keep the value I want to check for color.

Then it's very easy to check the cell value in the StringGrid during then OnDrawColumnCell event of the grid and so manage the color.

Cherry on the cake changes (insert,add,modify) are synchronous
in attachment a sample : name column back color=pink when it is Shells

Read More...

Serge Girard replied to the topic 'FireDac Questions' in the forum. 4 months ago

pkey query is needed to get fieldnames if you don't want this i think you have to use an explicit query
i.e. {code}Select col1,col2,col3 from mytable{/code}
Count query is needed so you can have access to FDQuery.recordcount, as I remember this one can be occulted with Fetchoptions (RecordCoundMode and LiveWindowParanoic)

Read More...

Hello

Is it because i use a "Professionnal" license?!

Yes, look at the feature matrix www.embarcadero.com/features/feature-matrix you will see a 2CX in Pro version column meaning not included except with Firedac Client/Server Pack

What is the solution?

Buying the Firedac Client/Server Pack I assume

Read More...

Hello,
How can i change a FontColor in my Tgrid ?

I know about OnCellDraw event i.e like this

procedure TForm15.Grid1DrawColumnCell(Sender: TObject; const Canvas: TCanvas;
  const Column: TColumn; const Bounds: TRectF; const Row: Integer;
  const Value: TValue; const State: TGridDrawStates);
var ARect : TRectF;
begin
   // change background color of Column[0]
   if Column.Index=0 then
    begin
     AColor:=TalphaColors.MoneyGreen;
     ARect:=TRectF.Create(Bounds);
     InflateRect(ARect,3,3);
     Canvas.Fill.Color:=AColor;
     Canvas.FillRect(ARect,0,0,[],1);
     Canvas.Fill.Color:=TalphaColors.Black;
     Canvas.FillText(Bounds,Value.ToString,false,1,[],TTextAlign.Leading);
    end;
end;
But if y can test the Value of the cell column I can't test a value in the dataset !

let say y have a table and grid with 3 columns (partname,price,lastsale) and i want the rows of my grid red if lastsale data is more than one year old .

My first attempt was to change the if statement in
If YearSpan(Mydata.FieldByname('lastSale').asDate,Date)>1 then 
     begin
        ...
     end;  
But it seems that the Mydata.FieldByname('lastSale').asDate don't change (first row of my Clientdataset)

Read More...

Serge Girard replied to the topic 'TListView Footer Text Live Bindings' in the forum. 7 months ago

Hello,
As you, I don't see how to do such thing with livebindings, only for headers !
So i use some tricks( not academic but ....) to fill these footers

...
 private 
    i : Integer;
...
// using a dynamic appearence , 2 text in item 

procedure TForm13.LinkListControlToField1FilledList(Sender: TObject);
var Pied,Temp : TListViewItem;
    texte : String;
    Li : integer;
begin
    // moving footer up 
     for Li := 1 to Pred(ListView1.ItemCount) do
     begin
       if ListView1.Items[Li].Purpose=TListItemPurpose.Footer then
         begin
           Pied:=ListView1.Items[Li];
           Texte:=Pied.Text;
           ListView1.Items.Delete(Li);
           Temp:=ListView1.Items.Insert(Li-1);
           temp.Text := Texte;
           temp.Purpose := TListItemPurpose.Footer;
         end;
     end;
 // last "record" 
  with ListView1.Items.Add do
    begin
      Text := Format('Last footer %d',[i]);
      Purpose := TListItemPurpose.Footer;
    end;
end;

procedure TForm13.LinkListControlToField1FilledListItem(Sender: TObject;
  const AEditor: IBindListEditorItem);
var AnItem, FItem : TListViewItem;
begin
AnItem:=AEditor.CurrentObject as TListViewItem;
if (AnItem.Purpose=TListItemPurpose.Header) then
 begin
  if (AnItem.Index>1)  then
   begin
      with ListView1.Items.Add do
       begin
          Text := Format('bloc footer %d',[i]);
          Purpose := TListItemPurpose.Footer;
         // to be moved later
     end;
    end;
  i:=0;
 end
 else  i:=i+StrToInt(AnItem.Data['Text2'].AsString);
end;

Hope there is another way to do that sort of thing but this trick works

Read More...