Jump to content

limelect

Members
  • Content Count

    924
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by limelect


  1. I just did something similar for my project

    1.put TRxWindowHook

    2. associate with your control . in my case it was a memo.

     

    catch Cnt C

     

    put this  KeyCount boolean

     

    procedure TForm2.RxWindowHook1BeforeMessage(Sender: TObject; var Msg: TMessage;
      var Handled: Boolean);
    begin
      if msg.msg = WM_KEYDOWN then
      begin
        if (msg.wparam = 17)  then
          KeyCount := true
        else if (msg.wparam = 67) and (KeyCount = true) then
        begin
          KeyCount := false;
          DoNotCopy := True; << i needed that on cont C
        end
        else
          KeyCount := false;
      end;

    end;
     


  2. @Darian Miller Just for fun

     

    JUST FOUND NO BRACKET IN MY SOURCE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    what an HTML PAGE !!!!! plz fix

     x:= StrToInt(s); <<<<<<<<<<<<  cannot put bracket i

     

    unit Unit1;

    interface

    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, JvExStdCtrls, JvEdit,
      JvValidateEdit, Vcl.Mask, JvExMask, JvSpin;

    type
      TForm1 = class(TForm)
        Button1: TButton;
        JvValidateEdit1: TJvValidateEdit;
        Label1: TLabel;
        Button2: TButton;
        JvValidateEdit2: TJvValidateEdit;
        Label2: TLabel;
        Button3: TButton;
        JvValidateEdit3: TJvValidateEdit;
        JvSpinEdit1: TJvSpinEdit;
        Label3: TLabel;
        Button4: TButton;
        Label4: TLabel;
        Label5: TLabel;
        Edit1: TEdit;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure Button4Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TForm1.FormCreate(Sender: TObject);
    begin
     Label1.Caption:='Answer';
     Label2.Caption:='Answer';
     Label3.Caption:='Answer';
    end;

    procedure TForm1.Button1Click(Sender: TObject); //to binary
    var
    i,x:integer;
    ans:string;
    begin
    ans:='';
    i:=  JvValidateEdit1.Value;
    while i>0 do
    begin
    ans:=IntToStr(i mod 2) + ans ;
    i :=i div 2;
    //ans:=IntToStr(i mod 2)+ans ;
    //i :=i div 2;
    end;
    Label1.Caption:=ans;
    end;

    procedure TForm1.Button2Click(Sender: TObject); //  to decimal
    var
    s:string;
    i,ans:Integer;
    begin
    ans:=1;
      s:=JvValidateEdit2.Text;
      for I := 1 to length(s)-1 do
       ans:=(ans*2) +StrToInt(s[i+1]);
       Label2.Caption:=IntToStr(ans);
    end;

    procedure TForm1.Button3Click(Sender: TObject);  //fraction cal
    var
    f:real;
    i,x:integer ;
    ans:string;
    begin
    ans:='0.';
      f:=JvValidateEdit3.Value;
     for I := 1 to Round(JvSpinEdit1.Value) do
     begin
      f:=f*2;
      x:=Trunc(f);
      f:=Frac(f);
      ans:=ans+IntToStr(x);
      end;
      Label3.Caption:=ans;
    end;

    // https://indepth.dev/the-simple-math-behind-decimal-binary-conversion-algorithms/

    procedure TForm1.Button4Click(Sender: TObject); //binary to fruction
    var
    s:string;
    k:Real;
    i,x:Integer;
    ans:string;
    begin
      k:=0;
     s:=Edit1.Text;
     for I :=Length(s) downto   1 do
     begin
     x:= StrToInt(s);
    k:=(1/2)*(x+k);
     end;
     Label5.Caption:=FloatToStr(k);
    end;

    end.

     

    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 283
      ClientWidth = 552
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      OnCreate = FormCreate
      PixelsPerInch = 120
      TextHeight = 16
      object Label1: TLabel
        Left = 335
        Top = 35
        Width = 37
        Height = 19
        Caption = 'Label1'
      end
      object Label2: TLabel
        Left = 335
        Top = 73
        Width = 37
        Height = 16
        Caption = 'Label2'
      end
      object Label3: TLabel
        Left = 335
        Top = 119
        Width = 27
        Height = 16
        Caption = 'anse'
      end
      object Label4: TLabel
        Left = 187
        Top = 155
        Width = 16
        Height = 21
        Caption = '0.'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -17
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
      end
      object Label5: TLabel
        Left = 335
        Top = 159
        Width = 27
        Height = 16
        Caption = 'anse'
      end
      object Button1: TButton
        Left = 66
        Top = 32
        Width = 110
        Height = 25
        Caption = 'To Binary'
        TabOrder = 0
        OnClick = Button1Click
      end
      object JvValidateEdit1: TJvValidateEdit
        Left = 182
        Top = 32
        Width = 121
        Height = 24
        CriticalPoints.MaxValueIncluded = False
        CriticalPoints.MinValueIncluded = False
        EditText = '582'
        TabOrder = 1
      end
      object Button2: TButton
        Left = 68
        Top = 70
        Width = 108
        Height = 25
        Caption = 'To Decimal'
        TabOrder = 2
        OnClick = Button2Click
      end
      object JvValidateEdit2: TJvValidateEdit
        Left = 182
        Top = 70
        Width = 121
        Height = 24
        CriticalPoints.MaxValueIncluded = False
        CriticalPoints.MinValueIncluded = False
        EditText = '1001000110'
        TabOrder = 3
      end
      object Button3: TButton
        Left = 66
        Top = 116
        Width = 110
        Height = 25
        Caption = 'Fruction Calc'
        TabOrder = 4
        OnClick = Button3Click
      end
      object JvValidateEdit3: TJvValidateEdit
        Left = 182
        Top = 117
        Width = 121
        Height = 24
        CriticalPoints.MaxValueIncluded = False
        CriticalPoints.MinValueIncluded = False
        DisplayFormat = dfFloat
        DecimalPlaces = 10
        EditText = '0.24'
        TabOrder = 5
      end
      object JvSpinEdit1: TJvSpinEdit
        Left = 481
        Top = 116
        Width = 63
        Height = 24
        MaxValue = 10.000000000000000000
        MinValue = 1.000000000000000000
        Value = 8.000000000000000000
        TabOrder = 6
      end
      object Button4: TButton
        Left = 73
        Top = 155
        Width = 108
        Height = 25
        Caption = 'Binary Fruction'
        TabOrder = 7
        OnClick = Button4Click
      end
      object Edit1: TEdit
        Left = 208
        Top = 155
        Width = 95
        Height = 24
        NumbersOnly = True
        TabOrder = 8
        Text = '1011'
      end
    end
     


  3. Found one drawback

      sx := TStringList(GetObjectProp(x, PropInfo)); // all the tabs
    this instruction cannot be made ONShow only On form create.

    It makes on second-time error.

    It has to execute only once.

    Which mean installing a new component will not

    update unless I restart Delphi.


  4. Ok my software is OK

    Now for Embarcadero to give some Answers.

    I have 2 components bar.

    1. D7 like.

    2. Tool pallet.

     

    They differ in what the show  position wise!!!!!

    For example, the Tool bar does not have BDE or ActivX in the same position !!!!

    What is going on?

     


  5. @dummzeuch without your lead I could not have done it

    I was thrown away by thinking that it was TabControl

    Thanks

    Checking that it works got the list of my tabs

     sx=tstringlist

       PropInfo:= GetPropInfo(x.ClassInfo, 'Items');
     sx:= TStringList(GetObjectProp(x,PropInfo));
     Label2.Caption:=inttostr(Sx.Count);
     Memo1.Clear;
     for I := 0 to Sx.Count-1 do
     Memo1.Lines.Add(sx) ;

    Great
    why cannot write  bracket i bracket ???????????


  6. @dummzeuch With the help of this link and IDE explorer  IIIIII DDDDIDDDD IT.

    From here I got https://stackoverflow.com/questions/2071247/dynamically-access-a-property-in-a-delphi-component/2071398

    var

    PropInfo: PPropInfo;

       x:=TComponent(x.FindComponent('TabControl'));
        PropInfo:= GetPropInfo(x.ClassInfo, 'TabIndex').;

    SetOrdProp(x, PropInfo, 3);  it press tab 4.

     

    Thanks every body and see you on my next NOT EASY problem.

     

    P.S may some know how to get a list of items from

    PropInfo:= GetPropInfo(x.ClassInfo, 'Items')  into StrinList?

     


  7. I will look further with your advice that it is TGradientTabSet and not TabControl

    But if I use IDE explorer (sorry not yours) I see all the properties

    and I do not see TABS but Items so you might be correct

     

    On CnWizard there is something to associate the toolbar

    search for TGradientTabSet. I will investigate


  8. Yes, I used your GREP already and I still, unfortunately, did not understand how to use it.

    Any idea?

    It will not work.

    For example, it has

    FTabList            :TList;

    FTabList            :TStringList;

    Is it allowed?

    Something fishy.

     

×