trichview.support
Re: page setup and actions |
Author |
Message |
Sergey Tkachenko |
Posted: 12/04/2004 1:58:00 It does not make sense to have several RVAControlPanels. All its properties, including events, are stored in global variables. If you assign event to one control panel, it will be assigned to all others. If your editors and rulers are placed in the same form, you can find ruler function GetRuler(rve: TCustomRichViewEdit): TRVRuler; var i: Integer; Form: TForm; begin Form := rve.Owner; for i := 0 to Form.ControlCount-1 do if (Form.Components[i] is TRVRuler) and (TRVRuler(Form.Components[i]).RichViewEdit=rve) then begin Result := TRVRuler(Form.Components[i]); exit; end; Result := nil; end; > > Sergey, > > Regarding the TRVAControlPanel, I can see that one central control would > be nice, but not only do I need to connect the RVPrint control, I also have > deal with the events that involve the ruler. For example, > > procedure TfmMacroEditor.RVAControlPanel1MarginsChanged(Sender: TrvAction; > Edit: TCustomRichViewEdit); > begin > RVRuler1.UpdateRulerMargins; > end; > > There is no property in TRichViewEdit or TRVAControlPanel that sets the ruler > -- instead, there is a RichViewEdit property in RVRuler. Therefore, within > the above event, if it is centralized, I have no way of knowing *which* RVRuler > I am updating unless I create a global variable. It seems complex to maintain, > and if there are not any negative effects, it seems easier to have several > copies of TRVAControlPanel. > > What do you think? > |
Powered by ABC Amber Outlook Express Converter