4 * Created on: 6 nov. 2008
12 //****************************************************
18 #include "common__tools.h"
21 //****************************************************
22 //****************************************************
26 wxBitmap
* BmpGet(const wxString
& ob_imgPath
);
27 void Invalidate(const wxString
& ob_imgPath
);
28 void Invalidate_ALL();
31 std::map
<wxString
,wxBitmap
*> map_Path_Bmps
;
35 //****************************************************
37 class wListFrames
: public wxControl
40 static FrameImgManager theFrameImgManager
;
43 wListFrames( wxWindow
*parent
);
44 void AssociateToListAnims( wxWindow
* _wList_anims
);
45 virtual ~wListFrames();
47 //------------------------------------------------------
48 void ReloadFrames(bool b_invalidate_images
= false);
50 void On_Selection_Bounds_Change();
51 void On_Ind_ActiveFrame_Change();
53 //------------------------------------------------------
54 void EvtPaint(wxPaintEvent
& event
);
55 void EvtSize( wxSizeEvent
& event
);
57 //------------------------------------------------------
58 void EvtScrollDown( wxScrollWinEvent
& event
);
59 void EvtScrollUp( wxScrollWinEvent
& event
);
60 void EvtScroll( wxScrollWinEvent
& event
);
61 void UpdateScrollBar();
63 //------------------------------------------------------
64 virtual void EvtMouseSomething(wxMouseEvent
& event
);
65 virtual void EvtCharPress(wxKeyEvent
& event
);
66 void EvtGetFocus(wxFocusEvent
& event
);
68 //------------------------------------------------------
69 void RefreshSelection(bool b_redo
= true );
70 void RestoreSelection( int sv_ind_active
, int sv_ind_first
, int sv_ind_last
);
71 void GetSelection( int& sv_ind_active
, int& sv_ind_first
, int& sv_ind_last
);
73 void SetSelected( int ind_frame
= -200
74 , int mod_AddToSelection
= 0
75 , bool b_propagate
= true );
76 void GetSelectedFrames( int& first_to_play
, int& last_to_play
);
77 ob_frame
* GetActiveFrame()const;
79 //------------------------------------------------------
80 void SetFlipFrame( int _flip_frame
);
81 void SetLandFrame( int _landframe
);
82 void SetDropFrame( int _dropframe
);
83 void SetJumpFrame( int _jumpframe
);
85 int GetSelectedFirst(){return select_first
;};
86 int GetSelectedLast(){return select_last
;};
88 //---------------------------------------------------------
89 // The associated list of anims
90 wxWindow
* wList_anims
;
93 //---------------------------------------------------------
97 FrameData():pos(0,0),size(0,0),related_frame(NULL
){};
100 ob_frame
* related_frame
;
103 std::vector
<FrameData
*> v_frames_datas
;
105 //---------------------------------------------------------
106 // ind of the first and last frames selected
107 int select_first
, select_last
;
108 // the frame that get the mouseDown event
109 int last_indframe_mouseDown
;
110 // the frame that have the dragging cursor on his right
111 int mouseDragging__last_left_frame
;
113 int GetFrameIndFromPos( int _x
, int _y
)const;
114 void GetCoupleFramesAssidePos( int m_x
, int m_y
, int &ind_left
, int &ind_right
)const ;
116 //---------------------------------------------------------
121 M_REFRESH_SELECTION
= 4,
126 //---------------------------------------------------------
127 void Clear(bool b_really_all
= true);
130 //---------------------------------------------------------
131 wxSize
DoGetBestSize() const;
133 DECLARE_EVENT_TABLE()
137 //****************************************************
139 class wListFrames_Editable
: public wListFrames
142 wListFrames_Editable( wxWindow
*parent
);
143 virtual ~wListFrames_Editable();
146 virtual void EvtMouseSomething(wxMouseEvent
& event
);
147 virtual void EvtCharPress(wxKeyEvent
& event
);
148 void EvtGetFocus(wxFocusEvent
& event
);
149 void EvtNewFrame(wxCommandEvent
& event
);
150 void EvtDeleteFrame(wxCommandEvent
& event
);
151 void EvtCopyFrame(wxCommandEvent
& event
);
152 void EvtContextMenu( wxContextMenuEvent
& event
);
154 bool DoDragging(int ind_frame
, int ind_left
, int ind_right
, wxMouseEvent
& event
);
157 DECLARE_EVENT_TABLE()
160 #endif /* WLISTFRAMES_BASE_H_ */