BpcSMScriptLibrary 3
PopUp Menu Utility Routines
Language: Delphi 7 - 2007
////////////////////////////////////////////////////////////////////////////////////////// //////// PopUp Menu Utility Routines ////////////////////////////////////////////////////////////////////////////////////////// interface uses Menus, Classes, DBGrids, Controls, Types, bpcStringList, Windows, Db; type TbpcComponentDynArray = array of TComponent; TbpcDBGridDynArray = array of TDBGrid; TbpcDataSourceDynArray = array of TDataSource; // Show a popupmenu at the cursor location, remembering the calling grid // If the source is a TDBGrid, use that, else use the controls DataSource for the Sender.PopupComponent procedure bpcPopMenu1GridShow(myPop : TPopupMenu; Sender: TDBGrid ); // Show a popupmenu at the cursor location, remembering the calling db component's datasource // If the source is a TDBGrid, use that, else use the controls DataSource for the Sender.PopupComponent procedure bpcPopMenu1DBControlShow(myPop : TPopupMenu; Sender: TDataSource ); // Show a popupmenu at the cursor location, remembering the calling component // If the source is a TDBGrid, use that, else use the controls DataSource for the Sender.PopupComponent procedure bpcPopMenu1Show(myPop : TPopupMenu; Sender: TComponent ); // Copy the selected rows from the dbgrid into the clipboard as an smXMLPacket function bpcPopMenu1Copy(Sender : TPopupMenu ) : boolean; // Copy the current row from a db control aware control's datasource into the clipboard as an smXMLPacket function bpcsmXMLDBControlCopy( Sender: TDataSource) : boolean ; // Copy the selected rows from the dbgrid into the clipboard as an smXMLPacket function bpcsmXMLDBGrid1Copy( Sender: TDBGrid) : boolean ; // Paste the selected rows to the db control held on the popmenu into the clipboard as an smXMLPacket // If the source is a TDBGrid, use that, else use the controls DataSource for the Sender.PopupComponent procedure bpcPopMenu1Paste(Sender : TPopupMenu; IndexBank : array of string; GridBank : array of TComponent); // Paste the clipboard into a db control aware control's datasource from the clipboard stored smXMLPacket procedure bpcsmXMLDBControlPaste( Sender: TComponent; IndexBank : array of string; GridBank : array of TComponent ) ; // Step through the list (array) of TDBGrid pointers and turn on or off (on mode) the row select mode. // Returns the value of mode. function bpcSwitchAllDBGridsToRowSelect( mode: boolean; Targets : array of TDBGrid) : boolean;