Page 1 of 1

form resize

Posted: 20 Jul 2006, 07:51
by xerp
I'm using cadviewx in delphi 7.

How to make cadviewx dwg fit to windows after main form resize event? currently I found when the main form resizes, the dwg image does not change,remains at the same position.

Thanks.

Love all, trust a few, do wrong to none.

Posted: 20 Jul 2006, 15:05
by support
Use the following procedure:

Code: Select all

//-----------------------------------------------------------------------
procedure TfmMain.FormResize(Sender: TObject);
var
  R: TxRectLong;
begin
  // Zoom drawing to viewing area,
  // 1.
  FCADViewX.DoToolButtonClick(tbFitToWindow); 
  // or other sample
  // 2. 
  //R := FCADViewX.PictureRect;
  //FCADViewX.Zoom(R);
end;
//-----------------------------------------------------------------------
Igor Tobolov (CADSoftTools support team)

please post questions to the forum or write to support@cadsofttools.com

Posted: 21 Jul 2006, 06:15
by xerp
FCADViewX.DoToolButtonClick(tbFitToWindow); works fine, but when the form is closed, there will be Debugger Exception Notification saying '
Project CADView.exe raised exception class EAccessViolation with message 'Access violation at address 0047A292 in module 'CADView.exe'. Rad of address 00000310',Process stopped. Use Step or Run to continue.

That is why I post previously. THanks for your help.

Love all, trust a few, do wrong to none.

Posted: 16 Aug 2007, 17:29
by support
Hello!

Beta version of CADViewX v.6 solves this problem. It is available at: http://www.cadsofttools.com/download/CADViewXRL.zip

Very important: method DoToolButtonClick has been removed. Please use the follwing way instead of <b>FCADViewX.DoToolButtonClick(tbFitToWindow)</b>:

Code: Select all

  CADViewX.Actions.Item("Fit to Window").Execute
Sergey.


Please post questions to the forum or write to support@cadsofttools.com