Jump to content

Abaksoft

uniGUI Subscriber
  • Posts

    1561
  • Joined

  • Last visited

  • Days Won

    87

Posts posted by Abaksoft

  1. Hi Farshad,

    Here is a classical exemple (like AllFeatures Unigui DEMO): 

    One TreeView on the MainForm,  where onClick event gives Frames (parent = mainForm).

     

    My question is :

     

    By the simple fact that all these Frames have mainForm as Parent,

    the code inside these Frames will be Thread Safe (without global variable ofcourse) ?

     

    Thank you again...

    Frames.zip

  2. Hi Farshad,

     

    Is it true, otherwise can i add  a form instance like this :

    function UniFrame1: TUniFrame1;    >>>   GetFormInstance

     

    As :

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics,
      Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses,
      uniGUIClasses, uniGUIFrame;
    
    type
      TUniFrame1 = class(TUniFrame)
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    function UniFrame1: TUniFrame1;
    
    implementation
    
    {$R *.dfm}
    
    uses
      MainModule, uniGUIApplication;
    
    function UniFrame1: TUniFrame1;
    begin
      Result := TUniFrame1(UniMainModule.GetFormInstance(TUniFrame1));
    end;
    
    
    end.
    

    thx...

  3. Oh...sorry i did'nt explain well,

     

     

    Here is a simple OOP sample, wich describe a classical inhireted classes.

    unit Class_Bird;
    
    interface
    uses Class_Animal;
    
    type
     TBird=Class(TAnimal)
    
     private
       fWeight:integer;
       procedure SetWeight(value:integer);
    
     public
       error:boolean;
    
       Constructor Create;
       function eat:string; override;
    
     published
       property Weight:integer read fWeight write SetWeight;
     end;
    
    
    implementation
    { TAnimal }
    
    function TBird.eat:string;
    var str:string;
    
    begin
      // fWeight  in gr
      if fWeight<1000 then
          str:='And I need 50 seeds per day !'
      else if (fWeight>=1000) and (fWeight<2000) then
          str:='And I need 80 seeds per day !'
      else
          str:='And I need 100 seeds per day !';
    
      result:=inherited + #13+ str;
    end;
    

    If i try to write this in an Unigui Thread Safe Unit , the recommended solution is to use UniGui DataModule.

    The problem is that I can'nt  inhereted my Class TBird from TAnimal, firstly and from TDataModule on the other hand !

     

    type
    TBird=Class(TAnimal)           ???

    TBird=Class(TDataModule)  ???

     

     

    In others words, How can I inhereted a TDataModule Class1 from an other TDataModule Class2  ?

    (each class is declared on separate DataModule).

     

    Thx...

    Animal.zip

  4. Hi Farshad,

     

    To simplify coding, i am using LiveBinding on my UniFrame (which is thread safe).

    Now, is LiveBindings ThreadSafe ?

     

    in the uses i see :

      System.Bindings.Outputs,

      Vcl.Bind.Editors,

      Vcl.Bind.DBEngExt,

      Data.Bind.Components,

      Data.Bind.DBScope,

      Data.Bind.EngExt,

      System.Rtti;

     

     

    It works fine on my computer (exe file). But what happens  in production (dll on a server) ?

    Thx...

     

    Delphi XE3 +  0.99.1182

     

  5. Hi Farshad,

    In the same optic of :
    http://forums.unigui.com/index.php?/topic/5116-is-a-standard-delphi-unit-thead-safe/?hl=thread+safe

    I created a DataModule unit and write there my Class :

    Unit scool;
    Type Tscool=class(DataModule)

    I do this to insure that all my funtions will be thread safe.

    Ok, now how can i inherite Tscool from an other thread safe class ?

    Can i do some think like:
    Type Tscool = Class(TUniversity)
    And create only University unit as a DataModule ?

    Thx...

  6. Add your calculated Field directly on your sql statment.

    "Select ....,Field1 || Field2 as MyURLField From..."

     

    And declare MyURLField as a persistant Field (Data) on your ClientDataSet or QueryDataSet.

    I used this well in the past with UIB, as it don't support Calculated Field.

     

    Regards.

×
×
  • Create New...