Jump to content

New component with TuniDBLookupComboBox


Javi
 Share

Recommended Posts

Hi Farshad

 

 

I'm making a new component.

 

unit UniEditText;

interface

uses
 SysUtils, Classes, Controls, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses,
 uniEdit, uniDBEdit, uniGUIBaseClasses, uniMultiItem, uniComboBox, uniDBComboBox,
 uniDBLookupComboBox, uniGUIClientEvents, uniGUIFont, UniPanel,  DBCtrls, uniLabel,
 Graphics, Dialogs;

type
 TUniEditText = class(TUniPanel)
 public
   constructor Create(AOwner: TComponent); override;
   destructor Destroy; override;
 published
 end;

procedure Register;

implementation

procedure Register;
begin
 RegisterComponents('Unigui Componentes', [TUniEditText]);
end;

{ TUniEditText }

constructor TUniEditText.Create(AOwner: TComponent);
var
 LookUp: TuniDBLookupComboBox;
 Edit: TUniDBEdit;
begin
 inherited Create(AOwner);

 // EDIT
 Edit:=TUniDBEdit.Create(self);
 Edit.Width:=100;
 Edit.Align := alBottom;
 Edit.Parent := Self;
 Edit.Color := clwhite;
 InsertControl(Edit);

 // LookUpcombo
 LookUp:=TuniDBLookupComboBox.Create(self);
 LookUp.Width:=100;
 LookUp.Align := alLeft;
 LookUp.Parent := Self;   //     <<=== ERROR:  Control '' has no parent window
 LookUp.Color := clwhite;
 InsertControl(LookUp);
end;

destructor TUniEditText.Destroy;
begin
 inherited Destroy;
end;

end.

 

I compile and install the new component without problems.

 

But when I insert the new component within a TUniForm (at design time), it generates the following error:

 

Control '' has no parent window

[5028144A]{vcl150.bpl  } Controls.TWinControl.CreateWnd (Line 9170, "Controls.pas" + 13) + $3B
[5025BA9B]{vcl150.bpl  } Graphics.TResourceManager.AssignResource (Line 1888, "Graphics.pas" + 17) + $D
[16A6E8C9]{uniGUI15.bpl} Uniguiclasses.TUniControl.CreateWnd + $9
[5028191A]{vcl150.bpl  } Controls.TWinControl.CreateHandle (Line 9340, "Controls.pas" + 3) + $4
[502856F8]{vcl150.bpl  } Controls.TWinControl.HandleNeeded (Line 11874, "Controls.pas" + 4) + $4
[502856EF]{vcl150.bpl  } Controls.TWinControl.HandleNeeded (Line 11873, "Controls.pas" + 3) + $7
[50285705]{vcl150.bpl  } Controls.TWinControl.GetHandle (Line 11880, "Controls.pas" + 1) + $2
[50281326]{vcl150.bpl  } Controls.TWinControl.CreateParams (Line 9085, "Controls.pas" + 22) + $2
[50E16CCA]{vcldb150.bpl} DBCtrls.TDBLookupComboBox.CreateParams (Line 5365, "DBCtrls.pas" + 1) + $4
[50E1503B]{vcldb150.bpl} DBCtrls.TDBLookupControl.GetBorderSize (Line 4535, "DBCtrls.pas" + 1) + $6
[50E178A7]{vcldb150.bpl} DBCtrls.TDBLookupComboBox.SetBounds (Line 5640, "DBCtrls.pas" + 1) + $13
[16A675EE]{uniGUI15.bpl} Uniguibaseclasses.TUniBaseControl.SetParent + $21E
[16A6EBC6]{uniGUI15.bpl} Uniguiclasses.TUniControl.SetParent + $AA
[23B72124]{UniJavi.bpl } Uniedittext.Finalization + $18
[21B9B4C7]{delphicoreide150.bpl} CompPalMgr.TComponentPalettePageItemDelegate.CreateComponent (Line 2564, "CompPalMgr.pas" + 2) + $7
[21079D8A]{designide150.bpl} ComponentDesigner.TComponentRoot.DoCreateComponent (Line 2322, "ComponentDesigner.pas" + 10) + $17
[2107F022]{designide150.bpl} ComponentDesigner.TComponentRoot.CreateCurrentComponent (Line 4384, "ComponentDesigner.pas" + 2) + $32
[2109636E]{designide150.bpl} Surface.TDesignSurface.CreateItem (Line 187, "Surface.pas" + 1) + $11
[2104E6BE]{designide150.bpl} Designer.TDesigner.DoDragCreate (Line 764, "Designer.pas" + 1) + $F
[2104EE98]{designide150.bpl} Designer.TDesigner.DragEnd (Line 928, "Designer.pas" + 19) + $3
[21051474]{designide150.bpl} Designer.TDesigner.MouseUp (Line 1710, "Designer.pas" + 1) + $2
[51B1CCA1]{vcldesigner150.bpl} VCLSurface.MouseEvent (Line 2908, "VCLSurface.pas" + 45) + $11
[5003AC1B]{rtl150.bpl  } System.TMonitor.Exit (Line 12537, "System.pas" + 2) + $7
[51B1D87B]{vcldesigner150.bpl} VCLSurface.TVclDesignSurface.IsDesignMsg (Line 3169, "VCLSurface.pas" + 48) + $6
[5003A336]{rtl150.bpl  } System.@IsClass (Line 11370, "System.pas" + 1) + $8
[5027DCDB]{vcl150.bpl  } Controls.TControl.WndProc (Line 6987, "Controls.pas" + 4) + $21
[502820C3]{vcl150.bpl  } Controls.TWinControl.IsControlMouseMsg (Line 9608, "Controls.pas" + 1) + $9
[50282830]{vcl150.bpl  } Controls.TWinControl.WndProc (Line 9831, "Controls.pas" + 144) + $6
[5034FB28]{vcl150.bpl  } Forms.TCustomForm.WndProc (Line 3961, "Forms.pas" + 191) + $5
[50281ED0]{vcl150.bpl  } Controls.TWinControl.MainWndProc (Line 9552, "Controls.pas" + 3) + $6
[500AFA64]{rtl150.bpl  } Classes.StdWndProc (Line 13491, "Classes.pas" + 8) + $0
[50358AF7]{vcl150.bpl  } Forms.TApplication.ProcessMessage (Line 9760, "Forms.pas" + 23) + $1
[50358B3A]{vcl150.bpl  } Forms.TApplication.HandleMessage (Line 9790, "Forms.pas" + 1) + $4
[50358E65]{vcl150.bpl  } Forms.TApplication.Run (Line 9927, "Forms.pas" + 26) + $3

 

If I believe the component without TuniDBLookupComboBox, everything works fine.

 

Thanks

JAvi

Link to comment
Share on other sites

  • 4 weeks later...
  • Administrators

Hi Farshad

 

While you solve this issue.

 

Can you tell me how to add the component DBLookUpComboBox, without causing the error?

 

Thank you.

 

Unfortunately I couldn't find a workaround for this. It becomes complicated when DBLookupComboBox is wrapped inside another uniControl. I'm investigating the issue.

Link to comment
Share on other sites

Unfortunately I couldn't find a workaround for this. It becomes complicated when DBLookupComboBox is wrapped inside another uniControl. I'm investigating the issue.

 

Thank you. I will wait, then.

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.

 Share

×
×
  • Create New...