~efargaspro/+junk/codeblocks-16.01-release

1 by damienlmoore at gmail
Code::Blocks 16.01
1
/*
2
* This file is part of wxSmith plugin for Code::Blocks Studio
3
* Copyright (C) 2006-2007  Bartlomiej Swiecki
4
*
5
* wxSmith is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* wxSmith is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
17
*
18
* $Revision: 7109 $
19
* $Id: wxsitemeditordragassist.h 7109 2011-04-15 11:53:16Z mortenmacfly $
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditordragassist.h $
21
*/
22
23
#ifndef WXSITEMEDITORDRAGASSIST_H
24
#define WXSITEMEDITORDRAGASSIST_H
25
26
#include "wxsitemeditorcontent.h"
27
#include "wxsitem.h"
28
#include <wx/dc.h>
29
#include <wx/bitmap.h>
30
31
/** \brief Class drawing additional data to help dragging */
32
class wxsItemEditorDragAssist
33
{
34
    public:
35
36
        enum DragAssistType
37
        {
38
            dtNone,
39
            dtOutline,
40
            dtColourMix
41
        };
42
43
        /** \brief Ctor */
44
        wxsItemEditorDragAssist(wxsItemEditorContent* Content);
45
46
        /** \brief Dctor */
47
        ~wxsItemEditorDragAssist();
48
49
        /** \brief Function starting new dragging process */
50
        void NewDragging();
51
52
        /** \brief Function draging additional stuff */
53
        void DrawExtra(wxsItem* Target,wxsItem* Parent,bool AddAfter,wxDC* DC);
54
55
    private:
56
57
        wxsItem* m_PreviousTarget;
58
        wxsItem* m_PreviousParent;
59
        bool m_PreviousAddAfter;
60
61
        wxBitmap* m_TargetBitmap;
62
        wxRect    m_TargetRect;
63
        bool      m_IsTarget;
64
65
        wxBitmap* m_ParentBitmap;
66
        wxRect    m_ParentRect;
67
        bool      m_IsParent;
68
69
        wxsItemEditorContent* m_Content;
70
71
        void UpdateAssist(wxsItem* NewTarget,wxsItem* NewParent,bool NewAddAfter);
72
        void RebuildParentAssist();
73
        void RebuildTargetAssist();
74
        inline DragAssistType AssistType();
75
        inline wxColour TargetColour();
76
        inline wxColour ParentColour();
77
        void ColourMix(wxImage& Image,const wxColour& Colour);
78
        void UpdateRect(wxRect& Rect,const wxBitmap& bmp);
79
};
80
81
#endif