Page 1 of 1

bug? reload RVF SRVCombobox control height changed

Posted: Wed Jun 13, 2012 1:53 am
by chuqingsheng
I insert SRVCombobox into RVF doc and set the srvcombobox control height with new value(< default value) . save it . but the control height changed after reload this rvf doc.

Posted: Wed Jun 13, 2012 10:32 am
by Sergey Tkachenko
Did you set SRVComboBox.Autosize = False?

Posted: Thu Jun 14, 2012 1:42 am
by chuqingsheng
Sergey Tkachenko wrote:Did you set SRVComboBox.Autosize = False?
Yes.

Code: Select all

procedure TfrmAppMain.InsertComboboxControl(RVEdit: TCustomRichViewEdit; ctrlname: string; ItemWidth: Integer; Items: TStrings);
var
  c_combobox: TSRVComboBox;
  i, w: Integer;
begin
  c_combobox := TSRVComboBox.Create(nil);
  c_combobox.Name := ctrlname;

  c_combobox.DropDownCount := 12;
  c_combobox.AutoSize := False; 
  c_combobox.Width := ItemWidth;
  c_combobox.Height := 15;
  c_combobox.AutoDropDown := True;
  c_combobox.Style := csDropDownList;
  c_combobox.Font.Size := 9;
  c_combobox.Edit.Font.Assign(c_combobox.Font);
  c_combobox.Parent := RVEdit;
  w := 0;
  for i := 0 to Items.Count - 1 do
  begin
    c_combobox.Items.Assign(Items);
  end;


  RVEdit.InsertControl(ctrlname, c_combobox, rvvaAbsTop);
  c_combobox.Update;
end;
[/code]

Posted: Fri Jun 15, 2012 3:01 pm
by chuqingsheng
Dear Sergey, have any suggest?

Posted: Mon Jun 18, 2012 10:13 am
by Sergey Tkachenko
I cannot reproduce this problem.
I tested in the InsertControl demo: added the code:

Code: Select all

c.Autosize := False;
c.Height := 5;
When copy-pasting a combobox (it must be the same as loading), it is inserted with the same height, 5 pixels.
(however, there is a glitch in redrawing after pasting, it disappears after mouse movement, we will fix it)

May be you use an old version of ScaleRichView?

Posted: Mon Jun 18, 2012 2:33 pm
by chuqingsheng
I use the last release version ,
I mean after load then rvf doc, not copy. I use srichviewedit.

Posted: Tue Jun 19, 2012 6:34 am
by Sergey Tkachenko
I saved the document using the same demo (Demos\Controls\InsertControls\), and it is loaded correctly (except for the above mentioned drawing glitch)