Jump to content

c is not a constructor


p2rcoder

Recommended Posts

last trial

 

I have form with tree and options panel. On options panel I show different frames which depends on selected node. I crated CustomFrame and several another frames inherited from custom. When I try to create frame I get error https://www.screencast.com/t/2gHWz5Mw35z

 

code:

 

procedure TfrmQuadMagic.SetTaskFrame;
var
  task_code: string;
begin
  task_code := quTask.FieldByName('rtl_task_code').AsString;
 
  if Assigned(FOptionsFrame) then
    FOptionsFrame.Free;
 
  if task_code = 'PRODIMP' then
    FOptionsFrame := TQMImportProductOptionFrame.Create(pnlOptions); <-- error here
 
  if Assigned(FOptionsFrame) then
    FOptionsFrame.SetOptions(quTask.FieldByName('rtl_options').AsString)
  else
    FOptionsFrame := TQMCustomOptionFrame.Create(pnlFrameOptions);
end;
 
This happened only when TuniCombobox at frame. When I deleted it and added only TuniMemo - frame created without error, but it doesn't show....
 
    FOptionsFrame := TQMImportProductOptionFrame.Create(pnlFrameOptions);
    FOptionsFrame.Show;
 
not visible after that
Link to comment
Share on other sites

just a solution - what works for me:

FCurrentFrame1 : TuniFrame;

...

 

 

if task_code = 'PRODIMP' then
begin

      FCurrentFrame1:=TUniFrameClass(FindClass('TQMImportProductOptionFrame')).Create(self);
      FCurrentFrame1.Align:=alClient;
      FCurrentFrame1.Parent:=:=display;   //uniscrollbox1; . i allways use a uniscrollbox for better UserInterface things
....
 
 
 
 
 
in MainForm.pas dont forget:
initialization
  RegisterAppFormClass(TMainForm);
  RegisterClasses([ TQMImportProductOptionFrame,
....
 
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...