Jump to content

UniContainerPanel - reduce size of traffic


erich.wanker

Recommended Posts

Hello,

 

 

i use a lot of UniContainerPanels in my project .. (as areas, as buttons, as moveable sliders and so on)

 

to reduce the traffic and to speed up the application i have a question:

 

a UniContainerPanel should be a "simple" DIV ...  i made the color, borders and hovereffect with css (in this example the css-class is "navigationsgrundflaeche" ... 

 

uniGUI makes a UniContainerPanel in 3 steps:

 

1.) <div class="x-container x-abs-layout-item navigationsgrundflaeche x-container-default x-abs-layout-ct" style="left: 0px; top: 71px; width: 190px; height: 35px;" id="O5AB_id">

 

2.) <span id="O5AB_id-outerCt" style="display: table; width: 100%; table-layout: fixed; height: 100%;" role="presentation">

 

3.) <div id="O5AB_id-innerCt" style="display:table-cell;height:100%;vertical-align:top;" class="" role="presentation">

 

 

Step 1 is clear ... BUT for what is Step2 and 3 ?

 

is it possible to delete step2 and 3 ?

what will i lose if step2 and 3 are not existing? (does "onClick, ondoubleclick ore something else not work?)

 

i think, a "smaler" UniContainerPanel will reduce the treffic about 30% .... and will speed up the application dramaticaly ;-)

 

 

 

A small example: For a uniFrame with 2 UniDBGrid´s and some functions i use:

 

ThanX and best regards

Erich

unit frame_vertrag;


interface


uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, StdCtrls,
  Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIFrame, uniLabel, Vcl.Imaging.pngimage, uniImage,
  uniGUIBaseClasses, uniPanel, uniHTMLFrame, uniScrollBox, uniBasicGrid,
  uniDBGrid, uniEdit, uniImageList, Vcl.Menus, uniMainMenu, uniDBText, Data.DB,
  ZAbstractRODataset, ZAbstractDataset, ZDataset, uniDBEdit,  uniTimer, uniListBox, uniMultiItem;


type
  TV_FRAME_VERTRAG = class(TUniFrame)
    UniPanel1: TUniPanel;
    UniContainerPanel3: TUniContainerPanel;
    UniContainerPanel4: TUniContainerPanel;
    UniContainerPanel20: TUniContainerPanel;
    UniImage4: TUniImage;
    UniDBGrid3: TUniDBGrid;
    UniContainerPanel33: TUniContainerPanel;
    UniContainerPanel34: TUniContainerPanel;
    UniImage10: TUniImage;
    suchpanel: TUniContainerPanel;
    UniEdit1: TUniEdit;
    filterpanel: TUniContainerPanel;
    UniContainerPanel24: TUniContainerPanel;
    UniContainerPanel42: TUniContainerPanel;
    UniLabel23: TUniLabel;
    UniContainerPanel62: TUniContainerPanel;
    UniImage6: TUniImage;
    UniContainerPanel63: TUniContainerPanel;
    UniLabel24: TUniLabel;
    UniContainerPanel66: TUniContainerPanel;
    UniImage13: TUniImage;
    UniContainerPanel67: TUniContainerPanel;
    UniContainerPanel68: TUniContainerPanel;
    UniContainerPanel69: TUniContainerPanel;
    UniContainerPanel70: TUniContainerPanel;
    UniContainerPanel85: TUniContainerPanel;
    UniContainerPanel86: TUniContainerPanel;
    UniImage20: TUniImage;
    UniContainerPanel87: TUniContainerPanel;
    UniContainerPanel88: TUniContainerPanel;
    UniImage21: TUniImage;
    UniContainerPanel96: TUniContainerPanel;
    UniContainerPanel97: TUniContainerPanel;
    UniImage23: TUniImage;
    UniContainerPanel98: TUniContainerPanel;
    UniContainerPanel99: TUniContainerPanel;
    UniImage24: TUniImage;
    UniContainerPanel1: TUniContainerPanel;
    UniContainerPanel17: TUniContainerPanel;
    UniImage8: TUniImage;
    UniHTMLFrame1: TUniHTMLFrame;
    UniContainerPanel47: TUniContainerPanel;
    UniLabel5: TUniLabel;
    UniContainerPanel49: TUniContainerPanel;
    UniLabel6: TUniLabel;
    UniLabel8: TUniLabel;
    STRUKTUR: TZQuery;
    DSTRUKTUR: TDataSource;
    OVERVIEW: TZQuery;
    DOVERVIEW: TDataSource;
    UniPanel3: TUniPanel;
    UniDBGrid2: TUniDBGrid;
    UniContainerPanel82: TUniContainerPanel;
    headline3: TUniLabel;
    filtershow_2: TUniContainerPanel;
    UniLabel13: TUniLabel;
    filterlabel_2: TUniLabel;
    UniContainerPanel38: TUniContainerPanel;
    UniImage9: TUniImage;
    UniContainerPanel7: TUniContainerPanel;
    UniContainerPanel8: TUniContainerPanel;
    UniContainerPanel9: TUniContainerPanel;
    UniImage1: TUniImage;
    UniContainerPanel10: TUniContainerPanel;
    UniContainerPanel11: TUniContainerPanel;
    UniImage2: TUniImage;
    UniContainerPanel12: TUniContainerPanel;
    UniContainerPanel13: TUniContainerPanel;
    UniImage3: TUniImage;
    UniContainerPanel31: TUniContainerPanel;
    UniContainerPanel32: TUniContainerPanel;
    UniImage7: TUniImage;
    UniContainerPanel44: TUniContainerPanel;
    UniContainerPanel46: TUniContainerPanel;
    UniImage11: TUniImage;
    UniContainerPanel50: TUniContainerPanel;
    UniContainerPanel83: TUniContainerPanel;
    headline2: TUniLabel;
    UniContainerPanel2: TUniContainerPanel;
    UniLabel1: TUniLabel;
    UniLabel18: TUniLabel;
    UniLabel19: TUniLabel;
    UniLabel20: TUniLabel;
    UniDBText1: TUniDBText;
    UniDBText2: TUniDBText;
    UniDBText3: TUniDBText;
    UniDBText4: TUniDBText;
    filterpanel_2: TUniContainerPanel;
    UniContainerPanel73: TUniContainerPanel;
    UniContainerPanel76: TUniContainerPanel;
    UniLabel27: TUniLabel;
    UniContainerPanel77: TUniContainerPanel;
    UniImage17: TUniImage;
    UniContainerPanel78: TUniContainerPanel;
    UniLabel28: TUniLabel;
    UniContainerPanel79: TUniContainerPanel;
    UniImage18: TUniImage;
    UniContainerPanel80: TUniContainerPanel;
    UniContainerPanel81: TUniContainerPanel;
    UniContainerPanel52: TUniContainerPanel;
    UniLabel2: TUniLabel;
    inhaltpanel: TUniContainerPanel;
    UniContainerPanel22: TUniContainerPanel;
    UniContainerPanel56: TUniContainerPanel;
    UniLabel16: TUniLabel;
    UniContainerPanel57: TUniContainerPanel;
    UniImage15: TUniImage;
    UniContainerPanel58: TUniContainerPanel;
    UniLabel21: TUniLabel;
    UniContainerPanel59: TUniContainerPanel;
    UniImage16: TUniImage;
    UniContainerPanel60: TUniContainerPanel;
    UniContainerPanel71: TUniContainerPanel;
    UniContainerPanel53: TUniContainerPanel;
    UniLabel3: TUniLabel;
    UniContainerPanel15: TUniContainerPanel;
    UniContainerPanel23: TUniContainerPanel;
    UniImage25: TUniImage;
    UniContainerPanel28: TUniContainerPanel;
    UniContainerPanel30: TUniContainerPanel;
    headline1: TUniLabel;
    suchshow_1: TUniContainerPanel;
    UniLabel4: TUniLabel;
    suchlabel_1: TUniLabel;
    UniContainerPanel19: TUniContainerPanel;
    UniImage12: TUniImage;
    filtershow_1: TUniContainerPanel;
    UniLabel12: TUniLabel;
    filterlabel_1: TUniLabel;
    UniContainerPanel84: TUniContainerPanel;
    UniImage19: TUniImage;
    UniContainerPanel36: TUniContainerPanel;
    UniContainerPanel43: TUniContainerPanel;
    UniContainerPanel89: TUniContainerPanel;
    UniImage26: TUniImage;
    TEMP: TZQuery;
    INHALT: TZQuery;
    DINHALT: TDataSource;
    ordner: TUniContainerPanel;
    UniEdit2: TUniEdit;
    UniContainerPanel94: TUniContainerPanel;
    UniContainerPanel103: TUniContainerPanel;
    UniLabel7: TUniLabel;
    UniContainerPanel104: TUniContainerPanel;
    UniContainerPanel105: TUniContainerPanel;
    UniLabel9: TUniLabel;
    UniContainerPanel106: TUniContainerPanel;
    UniImage27: TUniImage;
    UniContainerPanel108: TUniContainerPanel;
    UniContainerPanel109: TUniContainerPanel;
    UniContainerPanel110: TUniContainerPanel;
    UniLabel10: TUniLabel;
    UniLabel11: TUniLabel;
    UniImage22: TUniImage;
    UniListBox1: TUniListBox;
    UniLabel14: TUniLabel;
    UniContainerPanel61: TUniContainerPanel;
    UniContainerPanel26: TUniContainerPanel;
    UniLabel25: TUniLabel;
    UniContainerPanel27: TUniContainerPanel;
    UniImage5: TUniImage;
    UniContainerPanel45: TUniContainerPanel;
    UniLabel33: TUniLabel;
    UniContainerPanel51: TUniContainerPanel;
    UniImage14: TUniImage;
    UniListBox2: TUniListBox;
    UniListBox3: TUniListBox;
    procedure UniFrameCreate(Sender: TObject);
    procedure UniContainerPanel2Click(Sender: TObject);
    procedure UniContainerPanel8Click(Sender: TObject);
    procedure UniContainerPanel31Click(Sender: TObject);
    procedure UniDBGrid2ColumnSort(Column: TUniDBGridColumn;
      Direction: Boolean);
    procedure UniContainerPanel50Click(Sender: TObject);
    procedure UniContainerPanel12Click(Sender: TObject);
    procedure UniContainerPanel33Click(Sender: TObject);
    procedure UniContainerPanel26Click(Sender: TObject);
    procedure UniContainerPanel45Click(Sender: TObject);
    procedure UniContainerPanel39Click(Sender: TObject);
    procedure UniContainerPanel4Click(Sender: TObject);
    procedure UniContainerPanel42Click(Sender: TObject);
    procedure UniContainerPanel56Click(Sender: TObject);
    procedure UniContainerPanel58Click(Sender: TObject);
    procedure UniContainerPanel76Click(Sender: TObject);
    procedure UniContainerPanel78Click(Sender: TObject);
    procedure UniDBGrid2FieldImageURL(const Column: TUniDBGridColumn;
      const AField: TField; var OutImageURL: string);
    procedure UniDBGrid3FieldImageURL(const Column: TUniDBGridColumn;
      const AField: TField; var OutImageURL: string);
    procedure UniContainerPanel63Click(Sender: TObject);
    procedure UniContainerPanel3MouseLeave(Sender: TObject);
    procedure UniImage10MouseEnter(Sender: TObject);
    procedure UniImage22MouseEnter(Sender: TObject);
    procedure UniImage7MouseEnter(Sender: TObject);
    procedure UniContainerPanel7MouseLeave(Sender: TObject);
    procedure UniContainerPanel96Click(Sender: TObject);
    procedure UniContainerPanel1Click(Sender: TObject);
    procedure UniContainerPanel87Click(Sender: TObject);
    procedure UniContainerPanel85Click(Sender: TObject);
    procedure UniDBGrid3DblClick(Sender: TObject);
    procedure DSTRUKTURDataChange(Sender: TObject; Field: TField);
    procedure UniEdit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure suchshow_1Click(Sender: TObject);
    procedure filtershow_1Click(Sender: TObject);
    procedure filtershow_2Click(Sender: TObject);
    procedure UniContainerPanel43Click(Sender: TObject);
    procedure UniContainerPanel15Click(Sender: TObject);
    procedure UniContainerPanel10Click(Sender: TObject);
    procedure UniDBGrid2DblClick(Sender: TObject);
    procedure UniEdit2KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure UniContainerPanel103Click(Sender: TObject);
    procedure UniContainerPanel105Click(Sender: TObject);
    procedure UniContainerPanel36MouseLeave(Sender: TObject);


  private
.....

 

 

 

Link to comment
Share on other sites

  • Administrators
unit uniGenericControl;
interface

uses
  Controls, Classes, Graphics, StdCtrls, uniGUIConst, uniGUIFont,
  Ext, UniGUIClasses, UniGUIInterfaces, uniGUITypes;

type
  TUniGenericControl = class(TUniControl)
  private
  protected
    procedure ConfigJSClasses(ALoading: Boolean); override;
  public
    constructor Create(AOwner: TComponent); override;  
  published
    property Align;
    property Anchors;
    property Color;
    property ClientEvents;
    property ScreenMask;    
    property OnMouseEnter;
    property OnMouseLeave;
    property OnMouseDown;
    property OnMouseUp;
    property OnClick;
    property OnDblClick;
    property OnAjaxEvent;
  end;
implementation

{ TUniGenericControl }

procedure TUniGenericControl.ConfigJSClasses(ALoading: Boolean);
begin
  JSObjects.DefaultJSClassName:='Ext.Component'
end;

constructor TUniGenericControl.Create(AOwner: TComponent);
begin
  inherited;
end;

end.

Here is what you need.

It will create a component which can not contain child controls.

 

If you need to add child controls you still need to use UniContainerPanel.

 

This control will be added in next build of uniGUI.

Link to comment
Share on other sites

  • 10 months later...
unit uniGenericControl;
interface

uses
  Controls, Classes, Graphics, StdCtrls, uniGUIConst, uniGUIFont,
  Ext, UniGUIClasses, UniGUIInterfaces, uniGUITypes;

type
  TUniGenericControl = class(TUniControl)
  private
  protected
    procedure ConfigJSClasses(ALoading: Boolean); override;
  public
    constructor Create(AOwner: TComponent); override;  
  published
    property Align;
    property Anchors;
    property Color;
    property ClientEvents;
    property ScreenMask;    
    property OnMouseEnter;
    property OnMouseLeave;
    property OnMouseDown;
    property OnMouseUp;
    property OnClick;
    property OnDblClick;
    property OnAjaxEvent;
  end;
implementation

{ TUniGenericControl }

procedure TUniGenericControl.ConfigJSClasses(ALoading: Boolean);
begin
  JSObjects.DefaultJSClassName:='Ext.Component'
end;

constructor TUniGenericControl.Create(AOwner: TComponent);
begin
  inherited;
end;

end.

Here is what you need.

It will create a component which can not contain child controls.

 

If you need to add child controls you still need to use UniContainerPanel.

 

This control will be added in next build of uniGUI.

 

 

I am wondering why do we require such component?

 

Thanks & Regards,

Bantu Kumar

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...