Jump to content

风吹小机机

uniGUI Subscriber
  • Posts

    157
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by 风吹小机机

  1. The main purpose of obtaining equipment information is to verify the validity of the software

    What good way do you have? No,

    Under the application program, this code can obtain the device information

    But an error is reported in UNGUI

    uses
      NB30,
      Winapi.ActiveX, System.Win.ComObj;

    {$region 'function GetWMIProperty(WMIType, WMIProperty: AnsiString): string;'}
    function GetWMIProperty(WMIType, WMIProperty: AnsiString): string;
    var
      Wmi, Objs, Obj: OleVariant;
      Enum: IEnumVariant;
      😄 Cardinal;
    begin
      try
        Wmi := CreateOleObject(AnsiString('WbemScripting.SWbemLocator'));
        Objs := Wmi.ConnectServer(AnsiString('.'), AnsiString('root\cimv2')).ExecQuery(AnsiString('Select * from Win32_' + WMIType));
        Enum := IEnumVariant(IUnknown(Objs._NewEnum));
        Enum.Reset;
        Enum.Next(1, Obj, C);
        Obj := Obj.Properties_.Item(WMIProperty, 0).Value;
        if VarIsArray(Obj) then
          Result := Obj[0]
        else
          Result := Obj;
      except
        Result := 'error';
      end;
    end;
    {$ENDREGION}
    //获取计算机名称
    function GetComputerName: string;
    begin
      Exit(GetWMIProperty('OperatingSystem', 'CSName'));
    end;
    //获取BISO序列号
    function GetBIOSSerialNumber: string;
    begin
      Exit(GetWMIProperty('BIOS', 'SerialNumber'));
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Memo1.Lines.Clear;
      Memo1.Lines.Add(GetComputerName);
      Memo1.Lines.Add(GetBIOSSerialNumber);
    end;

  2. On 6/14/2021 at 1:40 AM, Sherzod said:

    Hello,

    "I would say not possible in most browsers, at least not without some additional plugins. And in any case I would try to avoid relying on the browser's zoom as the implementations vary (some browsers only zoom the fonts, others zoom the images, too etc). Unless you don't care much about user experience."

    https://stackoverflow.com/questions/1055336/changing-the-browser-zoom-level

    Draft:

    var currFFZoom = 1;
    var currIEZoom = 100;
    if (Ext.browser.name == 'Firefox') {
        var step = 0.02;
        currFFZoom += step;
        $('body').css('MozTransform', 'scale(' + currFFZoom + ')');
    } else {
        var step = 2;
        currIEZoom += step;
        $('body').css('zoom', ' ' + currIEZoom + '%');
    }

    ...

    According to this setting, you can't pull in full screen

    As shown in the figure:

    不会自动拉申.png

  3. Is there a method like CXGRID

    cxGrid1DBTableView1.DataController.PostEditingData;

     

    Because I found that after changing the data on the unidbgrid,

    Save the data set directly on the button, such as CDs Post, it is found that the data set is not saved to the current modified value, and the cursor must be moved to update the data set

  4.   MenuTree.ClientEvents.ExtEvents.Values['afterlayout'] := ' function afterlayout(sender, layout, eOpts)'
                                                            + ' {'
                                                            + '    Ext.get("' + MenuTree.JSId + '").setStyle({"background-color":"rgba(0,0,0,0)"});'
                                                            + '    if(!!Ext.get("' + MenuTree.JSId + '").el.dom.children[0].id){'
                                                            + '      var kid = Ext.get("' + MenuTree.JSId + '").el.dom.children[0].id;'
                                                            + '      Ext.get(kid).setStyle({"background-color":"rgba(0,0,0,0)"});'
                                                            +'     };'
                                                            + ' }';

    Set the tree menu background to transparent

  5. 3 hours ago, Abaksoft said:

    Thx.

    Could you please explain in more details. I am curious to see that.

    That is, the module code is written in the DLL, and the basic code is written in the framework body [such as connecting data, calling permission, etc.]

    DLL and framework body interact with each other through Delphi internal interface

    Of course, my framework can be separated from Delphi development [i.e. online runtime development], but some special functions still need to be encapsulated by modular DLL. My DLL can support unifrom and uniframe, and can also register the functions and processes inside the framework

  6. unit Unit2;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics,
      Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
      uniGUIClasses, uniGUIFrame, uniGUIBaseClasses, uniPanel;

    type
      TUniFrame2 = class(TUniFrame)
        P: TUniContainerPanel;
        SP: TUniSimplePanel;
      private
        { Private declarations }
      public
        { Public declarations }
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
      end;

    implementation

    {$R *.dfm}

    constructor TUniFrame2.Create(AOwner: TComponent);
    begin
      inherited Create(AOwner);
      p.ClientEvents.ExtEvents.Values['afterlayout'] := 'function afterlayout(sender, layout, eOpts)'
                                                      + ' {'
                                                      + ' var PWidth = Ext.get("' + p.jsid + '").getWidth ();'
                                                      + ' var PHegith = Ext.get("' + p.jsid + '").getHeight();'
                                                      + ' var FWidth = Ext.get("' + SP.jsid + '").getWidth();'
                                                      + ' var FHegith = Ext.get("' + SP.jsid + '").getHeight();'

                                                      + ' var PLeft = FWidth / 2  - PWidth/2;'
                                                      + ' var PTop  = FHegith / 2 - PHegith/2;'
                                                      + ' Ext.get("' + p.JSId + '").setStyle({"top":PTop + "px","left":PLeft + "px"});'
                                                      +'}';

    end;
    destructor TUniFrame2.Destroy;
    begin

      inherited Destroy;
    end;

    end.
     

    object UniFrame2: TUniFrame2
      Left = 0
      Top = 0
      Width = 472
      Height = 355
      Align = alClient
      Anchors = [akLeft, akTop, akRight, akBottom]
      TabOrder = 0
      ExplicitWidth = 320
      ExplicitHeight = 240
      object SP: TUniSimplePanel
        Left = 0
        Top = 0
        Width = 472
        Height = 355
        ParentColor = False
        Align = alClient
        TabOrder = 0
        ExplicitLeft = 68
        ExplicitTop = 181
        ExplicitWidth = 256
        ExplicitHeight = 128
        object P: TUniContainerPanel
          Left = 13
          Top = 14
          Width = 256
          Height = 128
          ParentColor = False
          Color = 12615680
          TabOrder = 1
        end
      end
    end

    • Thanks 1
×
×
  • Create New...