library: libGuiBld
#include "TGuiBldDragManager.h"

TGuiBldDragManager


class description - header file - source file - inheritance tree (.pdf)

class TGuiBldDragManager : public TVirtualDragManager, public TGFrame

Inheritance Chart:
TVirtualDragManager
TObject
<-
TGObject
<-
TGWindow
TQObject
<-
TGFrame
<-
TGuiBldDragManager
    private:
void AddClassMenuMethods(TGPopupMenu* menu, TObject* object) void AddDialogMethods(TGPopupMenu* menu, TObject* object) void BreakLayout() virtual Bool_t Cancel(Bool_t delSrc) Bool_t CanChangeLayout(TGWindow* w) const Bool_t CanChangeLayoutOrder(TGWindow* w) const Bool_t CanCompact(TGWindow* w) const void ChangeSelected(TGFrame* f) Bool_t CheckDragResize(Event_t* event) Bool_t CheckTargetAtPoint(Int_t x, Int_t y) void CheckTargetUnderGrab() void CloneEditable() void CloseMenus() void Compact(Bool_t global = kTRUE) void CreateListOfDialogs() void CreatePropertyEditor() void DeleteFrame(TGFrame* frame) void DeleteMenuDialog() void DeletePropertyEditor() void DoMove() virtual void DoRedraw() void DoReplace(TGFrame* frame) void DoResize() void DrawGrabRect(Int_t i, Int_t x, Int_t y) void DrawGrabRectangles(TGWindow* win = 0) void DrawLasso() virtual Bool_t Drop() void DropCanvas(TGCanvas* canvas) virtual Bool_t EndDrag() TGCompositeFrame* FindCompositeFrame(Window_t id) TGCompositeFrame* FindLayoutFrame(TGFrame* f) TGFrame* FindMdiFrame(TGFrame* in) TGFrame* GetBtnEnableParent(TGFrame* fr) TGFrame* GetEditableParent(TGFrame* f) TList* GetFramesInside(Int_t x0, Int_t y0, Int_t x, Int_t y) static TGColorDialog* GetGlobalColorDialog(Bool_t create = kTRUE) static TGFontDialog* GetGlobalFontDialog() TGFrame* GetMovableParent(TGWindow* p) TGWindow* GetResizableParent(TGWindow* p) void GrabFrame(TGFrame* frame) void HandleAlignment(Int_t to, Bool_t lineup = kFALSE) void HandleButon3Pressed(Event_t*, TGFrame* frame = 0) virtual Bool_t HandleButton(Event_t*) Bool_t HandleButtonPress(Event_t*) Bool_t HandleButtonRelease(Event_t*) virtual Bool_t HandleClientMessage(Event_t*) virtual Bool_t HandleConfigureNotify(Event_t*) void HandleCopy(Bool_t brk_layout = kTRUE) void HandleCut() void HandleDelete(Bool_t crop = kFALSE) Bool_t HandleDestroyNotify(Event_t*) virtual Bool_t HandleDoubleClick(Event_t*) virtual Bool_t HandleEvent(Event_t*) virtual Bool_t HandleExpose(Event_t*) void HandleGrid() void HandleLayoutOrder(Bool_t forward = kTRUE) virtual Bool_t HandleMotion(Event_t*) void HandlePaste() void HandleReplace() void HandleReturn(Bool_t on = kFALSE) virtual Bool_t HandleSelection(Event_t*) virtual Bool_t HandleSelectionRequest(Event_t*) virtual Bool_t HandleTimer(TTimer*) void HideGrabRectangles() void HighlightCompositeFrame(Window_t) virtual Bool_t IgnoreEvent(Event_t* e) TGFrame* InEditable(Window_t id) Bool_t IsEditDisabled(TGWindow* f) const Bool_t IsEventsDisabled(TGWindow* f) const Bool_t IsFixedH(TGWindow* f) const Bool_t IsFixedLayout(TGWindow* f) const Bool_t IsFixedSize(TGWindow* f) const Bool_t IsFixedW(TGWindow* f) const Bool_t IsGrabDisabled(TGWindow* f) const Bool_t IsLassoDrawn() const Bool_t IsMoveWaiting() const Bool_t IsPasteFrameExist() Bool_t IsPointVisible(Int_t x, Int_t y) Bool_t IsSelectedVisible() static void MapGlobalDialog(TGMainFrame* dialog, TGFrame* fr) void Menu4Frame(TGFrame*, Int_t x, Int_t y) void Menu4Lasso(Int_t x, Int_t y) void PlaceFrame(TGFrame*, TGLayoutHints*) void PutToCanvas(TGCompositeFrame* cont) void RaiseMdiFrame(TGFrame* in) Bool_t RecognizeGesture(Event_t*, TGFrame* frame = 0) void ReparentFrames(TGFrame* newfr, TGCompositeFrame* oldfr) void Reset1() Bool_t Save(const char* file = "") Bool_t SaveFrame(const char* file = "0") void SelectFrame(TGFrame* frame, Bool_t add = kFALSE) void SetCursorType(Int_t cur) void SetLassoDrawn(Bool_t on) void SetPropertyEditor(TGuiBldEditor* e) virtual Bool_t StartDrag(TGFrame* src, Int_t x, Int_t y) void SwitchEditable(TGFrame* frame) void SwitchLayout() void ToGrid(Int_t& x, Int_t& y) void UngrabFrame() void UnmapAllPopups() public:
TGuiBldDragManager() TGuiBldDragManager(const TGuiBldDragManager&) virtual ~TGuiBldDragManager() void ChangeBackgroundColor(TGListBox*) void ChangeBackgroundColor(TGCanvas*) void ChangeBackgroundColor(TGComboBox*) void ChangeBackgroundColor(TGFrame*) void ChangeBackgroundColor(TGCompositeFrame*) void ChangeBarColor(TGProgressBar*) void ChangeImage(TGIcon*) void ChangePicture(TGPictureButton*) void ChangeProperties(TGLabel*) void ChangeProperties(TGTextButton*) void ChangeTextColor(TGGroupFrame*) void ChangeTextColor(TGLabel*) void ChangeTextColor(TGTextButton*) void ChangeTextColor(TGProgressBar*) void ChangeTextColor(TGTextEntry*) void ChangeTextFont(TGGroupFrame*) void ChangeTextFont(TGTextEntry*) static TClass* Class() void DoClassMenu(Int_t) void DoDialogApply() void DoDialogCancel() void DoDialogOK() Bool_t GetDropStatus() const virtual Int_t GetEndDragX() const virtual Int_t GetEndDragY() const UInt_t GetGridStep() TGFrame* GetSelected() const virtual Int_t GetStrartDragX() const virtual Int_t GetStrartDragY() const TGFrame* GetTarget() const void HandleAction(Int_t act) virtual Bool_t HandleKey(Event_t*) void HandleUpdateSelected(TGFrame*) virtual TClass* IsA() const Bool_t IsStopped() const void SetBuilder(TRootGuiBuilder* b) virtual void SetEditable(Bool_t on = kTRUE) void SetGridStep(UInt_t step) virtual void ShowMembers(TMemberInspector& insp, char* parent) void Snap2Grid() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
TGuiBldDragManagerPimpl* fPimpl private data TRootGuiBuilder* fBuilder pointer to gui builder TGuiBldEditor* fEditor frame property editor Bool_t fLassoDrawn kTRUE if lasso drawn TString fPasteFileName paste_clippboard file name TString fTmpBuildFile temporary file name Bool_t fSelectionIsOn selection with Shift key pressed TGPopupMenu* fFrameMenu context menu for frames TGPopupMenu* fLassoMenu context menu for lasso drawn Window_t fTargetId an id of window where drop Bool_t fDropStatus kTRUE if drop was successfull Bool_t fStop kTRUE if stopped TGFrame* fSelected selected frame. In most cases selected is TList* fListOfDialogs list of dialog methods static TGColorDialog* fgGlobalColorDialog color dialog static TGFontDialog* fgGlobalFontDialog font dialog

Class Description

                                                                      
 TGuiBldDragManager                                                   
                                                                      

TGuiBldDragManager()
 Constructor. Create "fantom window".
~TGuiBldDragManager()
 Destructor
void Reset1()
 Reset some parameters
void CreateListOfDialogs()
 Create a list of dialog methods
void Snap2Grid()
 Draw grid on editable frame and restore background on previuosly editted one
UInt_t GetGridStep()
 Return the grid step
void SetGridStep(UInt_t step)
 Set the grid step
Bool_t IgnoreEvent(Event_t *event)
 Return kTRUE if event is rejected for processing by drag manager
TGFrame* InEditable(Window_t id)
 Return a pointer to the parent window (which is being editted)
TGCompositeFrame * FindCompositeFrame(Window_t id)
 Find the first composite parent of window
void SetCursorType(Int_t cur)
 Set cursor for selcted/grabbed frame.
Bool_t CheckDragResize(Event_t *event)
 Check resize type event.
void DoRedraw()
 Redraw the editted window
void SwitchEditable(TGFrame *frame)
 Switch editable
void SelectFrame(TGFrame *frame, Bool_t add)
 Grab/Select frame
void ChangeSelected(TGFrame *fr)
 Inform outside wold that selected frame was changed
void GrabFrame(TGFrame *frame)
 grab frame (see SelectFrame)
void UngrabFrame()
 Ungrab/Unselect selected/grabbed frame.
Bool_t IsPointVisible(Int_t xi, Int_t yi)
 Helper function for IsSelectedWindow method
Bool_t IsSelectedVisible()
 Return kTRUE if grabbed/selected frame is not overlapped by other windows.
void DrawGrabRectangles(TGWindow *win)
 Draw small grab rectangles around grabbed/selected/frame
void DrawGrabRect(Int_t i, Int_t x, Int_t y)
 Helper method to draw grab rectangle at position x,y
void HighlightCompositeFrame(Window_t win)
 Raise composite frame when mouse is moving over it.
 That allows to highlight position of "plain" composite frames.
Bool_t HandleTimer(TTimer *t)
 The main event loop is  originated here
 It repeadeatly queries pointer state and position on the screen.
 From this info an Event_t structure is built.
Bool_t RecognizeGesture(Event_t *event, TGFrame *frame)
 Recognize what was done when mouse button pressed
void HandleButon3Pressed(Event_t *event, TGFrame *frame)
 Handle 3d mouse pressed (popup context menu)
Bool_t HandleButton(Event_t *event)
 Handle button event occured in some ROOT frame
Bool_t HandleConfigureNotify(Event_t *event)
 Resize events
Bool_t HandleExpose(Event_t *event)
 Handle repaint event
Bool_t HandleEvent(Event_t *event)
 Handle all events.
Bool_t HandleDoubleClick(Event_t *)
 Mouse double click handler (never should happen)
TGFrame * GetBtnEnableParent(TGFrame *fr)
 Return a parent which can handle button evevents.
void UnmapAllPopups()
 Unmap all popups
Bool_t HandleButtonPress(Event_t *event)
 Handle button press event
Bool_t HandleButtonRelease(Event_t *event)
 Handle button release event
Bool_t HandleKey(Event_t *event)
 Handle key event
void ReparentFrames(TGFrame *newfr, TGCompositeFrame *oldfr)
 Reparent frames
TList * GetFramesInside(Int_t x0, Int_t y0, Int_t x, Int_t y)
 Return the list of frames inside of some area
void DropCanvas(TGCanvas *canvas)
 Drop canvas container
void PutToCanvas(TGCompositeFrame *cont)
 Create a new TGCanvas and place container into it
void HandleReturn(Bool_t on)
 Handling of  return/enter key pressing

 If on is kFALSE:
    If Return or Enter key was pressed - Grab Act
    If lasso is  drawn - new composite frame is created and
                         all frames inside lasso adopted as childrens.
    If lasso is not drawn and selected frame is composite one,
                       - new TGCanvas widget is created and selcted frmae became
                         container for this canvas.

 If on is kTRUE:
    If Return or Enter key was pressed with Control Key - Drop Act,
    The opposite action to the Grab Act.
    If selected/grabbed frame is not a TGCanvas widget -
          all frames inside the grabbed/selected frame are "dropped" into
          the underlying frame and the grabbed frame is deleted.

    If selected/grabbed frame is a TGCanvas widget -
          container frame "dropped" to editable frame
void HandleAlignment(Int_t to, Bool_t lineup)
 Align frames located inside lasso area.
void HandleDelete(Bool_t crop)
 Handle delete or crop action

 crop is kFALSE - delete action
   - if lasso is drawn -> all frames inside lasso area are deleted
   - if frame is grabbed/selected -> the frame is deleted
 crop is kTRUE - crop action
   - if lasso is drawn -> all frames outside of lasso area are deleted
   - if frame is grabbed/selected -> all frames except the grabbed frame are deleted
     In both cases the main frame is shrinked to the size of crop area.
void DeleteFrame(TGFrame *frame)
 Delete frame
void HandleCut()
 Handle cut action
void HandleCopy(Bool_t brk_layout)
 Handle copy. This method is also used by SaveFrame method.
 In later case  brk_layout == kFALSE
void HandlePaste()
 Handle paste action.
void DoReplace(TGFrame *frame)
 Replace frame (doesn't work yet properly)
void HandleReplace()
 Handle replace
void CloneEditable()
 Create a frame which is the same as currently editted frame
Bool_t Save(const char *file)
 Save an editted frame to the file
Bool_t SaveFrame(const char *file)
 Save composite frame as macro
void DoResize()
 handle resize
void DoMove()
 Handle move
TGFrame * FindMdiFrame(TGFrame *in)
 Return a pointer to the parent mdi frame
void RaiseMdiFrame(TGFrame *comp)
 Raise guibuilder's mdi frame.
void CheckTargetUnderGrab()
 Look for the drop target under grabbed/selected frame while moving
Bool_t CheckTargetAtPoint(Int_t x, Int_t y)
 Helper. Look for the drop target under grabbed/selected frame while moving.
Bool_t HandleMotion(Event_t *event)
 Handle motion event
void PlaceFrame(TGFrame *frame, TGLayoutHints *hints)
 Put created frame at position of the last mouse click
void DrawLasso()
 Draw lasso for allocation new object
Bool_t HandleClientMessage(Event_t *event)
 Handle client message
Bool_t HandleDestroyNotify(Event_t *event)
 Handle destroy notify
Bool_t HandleSelection(Event_t *)
 not used yet.
Bool_t HandleSelectionRequest(Event_t *)
 not used yet.
TGFrame * GetMovableParent(TGWindow *p)
 Find parent frame which can be dragged
TGWindow * GetResizableParent(TGWindow *p)
 Find parent frame which can be resized
Bool_t StartDrag(TGFrame *src, Int_t x, Int_t y)
 Start dragging.
Bool_t EndDrag()
 End dragging.
Bool_t Drop()
 Drop grabbed frame
Bool_t IsMoveWaiting()
 Waits for either the mouse move from the given initial ButtonPress location
 or for the mouse button to be released. If mouse moves away from the initial
 ButtonPress location before the mouse button is released "IsMoveWaiting"
 returns kTRUE. If the mouse button released before the mose moved from the
 initial ButtonPress location, "IsMoveWaiting" returns kFALSE.
void Compact(Bool_t global)
 Layout and Resize frame.
 If global is kFALSE - compact selected frame
 If global is kFALSE - compact main frame of selected frame
void SetEditable(Bool_t on)
 Grab server.
void ToGrid(Int_t &x, Int_t &y)
 Return grid coordinates which are close to given
void HandleAction(Int_t act)
 Main handler of actions
Bool_t CanChangeLayout(TGWindow *w)
  kTRUE - if it's possible to switch disable/enable layout
Bool_t CanChangeLayoutOrder(TGWindow *w)
 kTRUE - if it's possible to change layout order in the parent's layout of window w
Bool_t CanCompact(TGWindow *w)
 kTRUE is frame could be compacted/"layouted"
void CreatePropertyEditor()
 Create widget property editor (it could be located outside of guibuilder)
void SetPropertyEditor(TGuiBldEditor *e)
 Helper method
void HandleLayoutOrder(Bool_t forward)
 Change layout order
void HandleGrid()
 Switch on/of grid drawn.
TGCompositeFrame * FindLayoutFrame(TGFrame *f)
 Helper to find a frame which can be layouted
void HandleUpdateSelected(TGFrame *f)
 When selected frame was changed by guibuilder editor -> update its appearence
void HideGrabRectangles()
 Hide/Unmap grab rectangles.
void DeletePropertyEditor()
 Delete widget property editor.
Int_t GetStrartDragX()
 Return the X coordinate where drag started
Int_t GetStrartDragY()
 Return the Y coordinate where drag started
Int_t GetEndDragX()
 Return the current X coordinate of the dragged frame
Int_t GetEndDragY()
 Returns the current Y coordinate of the dragged frame
void BreakLayout()
 Disable/Enable layout for selected/grabbed composite frame.
void SwitchLayout()
 Switch Horizontal/Vertical layout of selected/grabbed composite frame
TGFrame * GetSelected()
 Return the current grabbed/selected frame.
void CloseMenus()
 Helper to close all menus
TGFrame * GetEditableParent(TGFrame *fr)
 Return the parent frame which can be editted.
void AddDialogMethods(TGPopupMenu *menu, TObject *object)
 Add DIALOG entries to the selected frame popup menu
void AddClassMenuMethods(TGPopupMenu *menu, TObject *object)
 Add entries with class //*MENU* methods
void DoClassMenu(Int_t id)
 Process a method choosen via frame context menu
void DeleteMenuDialog()
 Delete dialog and trash
void DoDialogOK()
 Process dialog OK button pressed
void DoDialogApply()
 Process dialog Apply button pressed
void DoDialogCancel()
 Process dialog Cancel button pressed
void Menu4Frame(TGFrame *frame, Int_t x, Int_t y)
 Create and  place context menu for selected frame
void Menu4Lasso(Int_t x, Int_t y)
 Create context menu for lasso actions.
Bool_t IsPasteFrameExist()
 Return kTRUE if paste frame exist.
TGColorDialog * GetGlobalColorDialog(Bool_t create)
 Return pointer to global color dialog. If dialog is not yet created
 and input parameter is kTRUE - the dialog will be created.
TGFontDialog * GetGlobalFontDialog()
 Create global font dialog.
void MapGlobalDialog(TGMainFrame *dialog, TGFrame *fr)
 Map dialog and place it relative to selected frame.
void ChangeBackgroundColor(TGFrame *fr)
 Change background color via context menu.
void ChangeBackgroundColor(TGCompositeFrame *fr)
 Change background color via context menu for this frame and all subframes.
 This method is activated via context menu during guibuilding.
void ChangeTextColor(TGGroupFrame *fr)
 Change text color via color selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeTextFont(TGGroupFrame *fr)
 Change text font via font selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeProperties(TGTextButton *fr)
 Edit properties via font selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeTextColor(TGTextButton *fr)
 Change text color via color selection dialog. This method is activated
 via context menu during guibuilding.
void ChangePicture(TGPictureButton *fr)
 Invoke file dialog to assign a new picture.
 This method is activated via context menu during guibuilding.
void ChangeBackgroundColor(TGCanvas *fr)
 Change background color via context menu
void ChangeBackgroundColor(TGComboBox *fr)
 Change background color for list box entries. This method is invoked
 via context menu during guibuilding.
void ChangeProperties(TGLabel *fr)
 Edit properties via font selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeTextColor(TGLabel *fr)
 Change text color via color selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeBackgroundColor(TGListBox *fr)
 Set background color for list box entries. This method is invoked
 via context menu during  guibuilding.
void ChangeBarColor(TGProgressBar *fr)
 Set progress bar color via TGColorDialog.
 This method is activated via context menu during guibuilding.
void ChangeTextColor(TGProgressBar *fr)
 Change text color which displays position.
void ChangeTextColor(TGTextEntry *fr)
 Set text color. This method is invoked
 via context menu during  guibuilding.
void ChangeTextFont(TGTextEntry *fr)
 Change text font via font selection dialog. This method is activated
 via context menu during guibuilding.
void ChangeImage(TGIcon *fr)
 Invoke file dialog to assign a new image.
 This method is activated via context menu during guibuilding.
void SetLassoDrawn(Bool_t on)
 Set lasso drawn flag
Bool_t IsEditDisabled(TGWindow *f)
Bool_t IsGrabDisabled(TGWindow *f)
Bool_t IsEventsDisabled(TGWindow *f)
Bool_t IsFixedLayout(TGWindow *f)
Bool_t IsFixedH(TGWindow *f)
Bool_t IsFixedW(TGWindow *f)
Bool_t IsFixedSize(TGWindow *f)
Bool_t Cancel(Bool_t delSrc)
Bool_t IsLassoDrawn()
TGuiBldDragManager()
Bool_t GetDropStatus()
void SetBuilder(TRootGuiBuilder *b)
Bool_t IsStopped()

Author: Valeriy Onuchin 12/09/04
Last update: root/guibuilder:$Name: $:$Id: TGuiBldDragManager.cxx,v 1.51 2006/07/05 07:02:22 brun Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.