Jump to content

eduardosuruagy

uniGUI Subscriber
  • Posts

    845
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by eduardosuruagy

  1. On 4/26/2020 at 6:38 PM, Tokay said:

    I was constantly missing feature of find defined session. It very important in some cases. I show you idea (if I understand all properly):

    
    unit Main;
    
    interface
    
    uses
     Windows, Messages, SysUtils, Variants, Classes, Graphics,
     Controls, Forms, Uni, uniGUITypes, uniGUIAbstractClasses,
     uniGUIClasses, uniGUIRegClasses, uniGUIForm;
    
    //this case shows how to run a long query without stopping the interface
    //additional thread for query
    type
     THelpThread = class(TThread)
     private
      FQuery:       TUniQuery;
      FSessionName: string;
     protected
      procedure Execute; override;
     public
      property Query: TUniQuery Read FQuery Write FQuery;
      property SessionName: string Read FSessionName Write FSessionName;
     end;
    
    type
     TMainForm = class(TUniForm)
      UniQuery1:      TUniQuery;
      UniDataSource1: TUniDataSource;
      UniDBGrid1:     TUniDBGrid;
     private
      FThread: THelpThread;
      procedure Thread1Finish(Sender: TObject);
      procedure StartCalcThread(const s: string);
      procedure AssignDataSet;
      { Private declarations }
     public
      { Public declarations }
     end;
    
    function MainForm: TMainForm;
    
    implementation
    
    {$R *.dfm}
    
    uses
     uniGUIVars, MainModule, uniGUIApplication;
    
    function MainForm: TMainForm;
    begin
     Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
    end;
    
    procedure TMainForm.StartCalcThread(const s: string);
    begin
     //startin of query thread
     if not Assigned(FThread) then
     begin
      //the query
      UniQuery1.SQL.Clear;
      UniQuery1.SQL.Add('select MAPS.MAPS_SOURCE,');
      UniQuery1.SQL.Add(s);
      UniQuery1.SQL.Add('from MAPS');
      UniQuery1.SQL.Add('group by MAPS_SOURCE');
      UniQuery1.SQL.Add('union');
      UniQuery1.SQL.Add('select "all",');
      UniQuery1.SQL.Add(s);
      UniQuery1.SQL.Add('from MAPS');
      //off the grid DataSource
      UniDBGrid1.DataSource := nil;
      FThread := THelpThread.Create(True);
      FThread.Query := UniQuery1;
      FThread.OnTerminate := Thread1Finish;
      FThread.FreeOnTerminate := True;
      //store the session ID {!!!!}
      FThread.SessionName := UniSession.SessionId;
      //start querying
      FThread.Start;
     end;
    end;
    
    procedure TMainForm.Thread1Finish(Sender: TObject);
    begin
     //sync assigned of dataset with the grid
     TThread.Synchronize(nil, AssignDataSet);
     FThread := nil;
    end;
    
    procedure TMainForm.AssignDataSet;
    var
     Session: TUniGUISession;
     lMainModule: TUniMainModule;
    begin
     //find session by ID {!!!!}
     Session := UniServerModule.GetSession(FThread.SessionName);
     //get defined MainModule of session
     lMainModule := TUniMainModule(Session.UniApplication.UniMainModule);
     //get defined MainForm of session
     with TMainForm(lMainModule.GetFormInstance(TMainForm)) do
     //assigne dataset and DataSource with grid
      UniDBGrid1.DataSource := UniDataSource1;
    end;
    
    initialization
     RegisterAppFormClass(TMainForm);
    
    end.

     

    I tried to simulate your example here, but I didn't find this TUniQuery component

  2. 16 minutes ago, Sherzod said:

    Bem, se você não levar em consideração o status do painel no lado do servidor, sim, poderá usar a operação no lado do cliente.

    I have a panel that has a width of zero 0, then I click the button and change the size to 300, all on the server side, but sometimes there is a delay in this process. Then I was wondering if you can do it on the client's side, or making it visible and invisible or changing its size.

  3. The folder example
    C: \ Program Files (x86) \ FMSoft \ Framework \ uniGUI \ Demos \ Desktop \ GridGrouping - Dynamic


    it is not working properly. If at design time I deselect the option UniDBGrid1.Grouping.Enabled and execute, dbgrid is unable to group the columns. You can only group it if the option UniDBGrid1.Grouping.Enabled is checked before execution. Can you adjust this?

  4. On 04/09/2019 at 09:14, eduardosuruagy said:

    Esses cilindro como vc fez?

     

    On 21/08/2019 at 16:45, Andriws Luna said:

     

    Olá a todos!

    Há um tempo atrás, procurei um componente ou algo que facilitasse o uso do Highcharts no Unigui, mas não obtive êxito.

    Então, decidi desenvolver meu próprio componente para fazer isso.

    Após 2 meses de trabalho, está em uma versão mais estável e decidiu compartilhar com a comunidade.

     

    Lembro que o Highcharts é gratuito apenas para uso pessoal.

     

    Faça o download no github:  https://github.com/andriwsluna/Unigui-Components

    
    

    EchoHightChart1.HighChartOptions.title.text.Value: = 'Introdução';
    EchoHightChart1.HighChartOptions.series.Datasource.DataSet: = FDMemTable1;
    EchoHightChart1.HighChartOptions.series.List.FieldNameForSerie: = 'Operação';
    EchoHightChart1.HighChartOptions.series.List.FieldNameForX: = 'month';
    EchoHightChart1.HighChartOptions.series.List.FieldNameForY: = 'value';
    EchoHightChart1.Load;

     

     

    Observe que existe uma fonte de dados para acesso a dados.

    Veja a demonstração:

     

    chart.png.8ed12fffd7f6ee8d61986cca9e6ed2be.png

    chart.thumb.png.31aa5239c8c56e0a77a4ac0c88176546.png

    PM me a contribuir com este projeto.

    Obrigado.

     

    Is there an example of how we can use this cylinder graph?

  5. 1 hour ago, Sherzod said:

    I still do not understand ...

    Perhaps you mean this (JS codes):

    
      //collapseAll
      MainForm.UniDBGrid1.getView().getFeature('grouping').collapseAll();
      //expandAll
      MainForm.UniDBGrid1.getView().getFeature('grouping').expandAll();

     

    Which unit do I need to declare to use this command?
    MainForm .UniDBGrid1.getView (). GetFeature ('grouping'). CollapseAll ();

×
×
  • Create New...