Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

Add other components to MagicScript 2 years 7 months ago #16151

  • Javier
  • Javier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 18
  • Thank you received: 0
Hi there

I was wondering if it is possible to add other componets to a MagicScript, like TRXDBgrid for example.

var
  f: TForm;
  b: TButton;
  g : TRXDBGrid ;  <---- 


Thanks in advance for your help


CT : 7.5 /
My OS : Windows 10
 

Please Log in or Create an account to join the conversation.

Add other components to MagicScript 2 years 7 months ago #16152

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4511
  • Thank you received: 1101
Yes Sir
use TmscrScript functions:

   function  Register_Class
   procedure Register_Object
   procedure Register_Component
   procedure Register_Form
   function  Register_Record
   procedure Register_Const
   procedure Register_Enum
   procedure Register_EnumSet
   procedure Register_Method
   procedure Register_Variable
   procedure Register_Type

I hope to release MagicScriptBuilder tool, at next primary CT version.
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Add other components to MagicScript 2 years 7 months ago #16153

  • Javier
  • Javier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 18
  • Thank you received: 0
Thank you for your answer

I am trying to do this:

ONCREATE FORM:

MSCR_GlobalScripter.Register_Class(TRxDBGrid,'TRxDBGrid') ;

ON SCRIPT:

var
  f: TForm;
  g: TRxDBGrid;

begin
  f := TForm.Create(nil);
  f.Caption := 'Test it!';
  f.BorderStyle := bsDialog;
  f.Position := poScreenCenter;

  g := TRxDBGrid.Create(f);
  g.Name := 'Grid1';
  g.Parent := f;
  g.SetBounds(10, 40, 75, 250);

  f.ShowModal;
  f.Free;
end.  

But I get this error:
STACK OVERFLOW OR STACK MISALIGNMENT

Am I forgetting something?


Thaks for your help.

Please Log in or Create an account to join the conversation.

Add other components to MagicScript 2 years 7 months ago #16154

  • Javier
  • Javier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 18
  • Thank you received: 0
Me again :)

And How to inherit properties and methods from those components I included

For example if I add an Edit component
  MSCR_GlobalScripter.Register_Component(Edit1);
  MSCR_GlobalScripter.Register_Component(SpinEdit1);

Edit does not have REPAINT method.
and SpinEdit1 Sent an error "Stack overflow or stack misalignment"  and close de Application

for i:= 10 do begin
    edit1.Text = IntToStr(i) ;
    edit1.Repaint ;    <--- Error
    spindedit1.Value := i ;
    spinfedit1.Repaint ;   <--- Error
end;

Thank you for your support.

Please Log in or Create an account to join the conversation.

Add other components to MagicScript 2 years 7 months ago #16155

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4511
  • Thank you received: 1101
You must register and REPAINT method of Edit1 and SpinEdit1
MagicScript auto register only Published properties NOT Public procedure, functions, etc.
If some public procedure, functions, etc missing you must register manual.

Look at Registration units of pl_MagicScript

MagicScriptBuilder tool do this job
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: Javier

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.
  • Page:
  • 1