0

THidepanel development is still putting many questions to me . I followed the instructions given here Other Help and Questions

I designed the inner panel now to have a red color and be a bit smaller as the outer panel. If I run the component in a test application only the outer panel is drawn and all components placed on the inner working panel and beeing visible at design time are no longer visible.

I assume the bug to be the following : the outedr panel is drawn as a last action and therefore at runtime I can not see the red inner panel and the components placed here? Is this true, where is my assumption wrong, what should I do to fix this problem

The latest Create function for my component comes here :

constructor THidePanel.create(aOwner: TComponent);
begin
  inherited;

  padding.Left:= BorderSize;
  padding.top:= BorderSize;
  padding.right:= BorderSize;
  padding.Bottom:= BorderSize;



  //  the inner panel
  WorkingPanel := TPanel.create(self);
  WorkingPanel.Caption := ' ';
  WorkingPanel.BevelOuter := bvNone;

  // WorkingPanel.BringToFront;

  WorkingPanel.Color :=220;
  WorkingPanel.ParentColor := false;
  WorkingPanel.Parent := self;
  WorkingPanel.Align := alClient;

  //  the button to mimimize / maximize
  FActivateButton := TButton.create(self);
  FActivateButton.Parent := self;
  FActivateButton.Caption := '<';
  FActivateButton.OnClick := H_ActivateButtonClick;
  FActivateButton.Width := BorderSize;

  FActivateButton.Height := BorderSize;


  ///   the restore values , correct setting
  FLargeWidth := self.Width;
  FLargeHeight := self.Height;
  FHasCustomSize := false;

  // here I draw the activate button on the outer panel
  SetButtonPosition(topright);


  //  drop components only on the inner panel
  ControlStyle := ControlStyle - [csAcceptsControls]

end;

DESIGN AND RUN TIME ISSUES

not vivible components at run time

Community
  • 1
  • 1
Franz
  • 1,883
  • 26
  • 47
  • 1
    What is the question. And please format your code in a more standard way. All that white space is annoying. Use the format source option in the IDE, for example. – David Heffernan Apr 10 '13 at 20:44
  • 5
    Franz, please note the difference between *boarder* and *border*. The latter refers to the edge of something, whereas the former refers to someone who pays you to sleep in your house and eat your food. – Rob Kennedy Apr 10 '13 at 20:59
  • 1
    Franz, I must apologize for my proposed approach, the .dfm will not be able to store the components placed on the working panel, so the second suggestion may be the needed implementation. – bummi Apr 10 '13 at 22:00

1 Answers1

1

Try setting WorkingPanel.Visible to True.

dthorpe
  • 35,318
  • 5
  • 75
  • 119
  • To explain the issue I add one more image to the question above, should I also post the complete source code for my compoent again – Franz Apr 11 '13 at 14:45