TCombo Box Drop Down

General TRichView support forum. Please post your questions here
Post Reply
kwfl
Posts: 2
Joined: Tue Aug 26, 2008 5:30 pm

TCombo Box Drop Down

Post by kwfl »

Using the RVEdit Demo that comes with the ScaleRichView component I have been playing around with adding a combo box into the RichView document (The Readme.rvf that comes with the example).

I did the following

1) On the Insert -> Component sub menu I added a new Menu Item for "Combo Box"

2) In the on Click for this event I added the following code:

Code: Select all


procedure TForm1.miInsertComboBoxClick(Sender: TObject);
var
  cb: TComboBox;
begin
  cb := TComboBox.Create(nil);
  srv.RichViewEdit.InsertControl('ComboBox1', cb, rvvaAbsMiddle);
  cb.Style := csDropDownList;
  cb.Items.Text := 'Left'#13'Right';
  if srv.RichViewEdit.CurItemStyle = rvsComponent then
    srv.RichViewEdit.SetCurrentItemExtraIntProperty(rvepResizable, 1, True);
  cb.OnClick := OnControlClick;
end;

Now the combo box will appear and I am able to select between left and right options however the drop down list does not appear under the combo box.

Instead when I click on the combo box the list appears over to the left and either above or below the box depending on it's screen position.

What am I missing? How do I make it appear under the box itself?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am not sure if it can be fixed, because the controls actually are inserted in a hidden TRichViewEdit, and ScaleRichView just draws their images. Popups for combo boxes cannot be drawn.
I'll ask Ilya if something can be done here.
kwfl
Posts: 2
Joined: Tue Aug 26, 2008 5:30 pm

Post by kwfl »

If you could find a solution I would be greatfull. I need this as part of my App and the TRichView seems to be the only component that comes close.
Post Reply