Changeset 624 in dev for trunk/ab5.0/abdev/abdev/include


Ignore:
Timestamp:
May 23, 2008, 10:35:36 PM (16 years ago)
Author:
dai_9181
Message:

WindowInfoクラスをリファクタリング

Location:
trunk/ab5.0/abdev/abdev/include/ProjectManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h

    r623 r624  
    22
    33
    4 namespace ActiveBasic{ namespace IDE{
     4namespace ActiveBasic{ namespace PM{
    55
    66class Project
     
    8383}}
    8484
    85 extern ActiveBasic::IDE::Project projectInfo;
     85extern ActiveBasic::PM::Project projectInfo;
  • trunk/ab5.0/abdev/abdev/include/ProjectManager/WindowManager.h

    r617 r624  
    22
    33
    4 namespace ActiveBasic{ namespace IDE{
    5 
    6 /*
     4namespace ActiveBasic{ namespace PM{
     5
     6
    77struct ImageReferenceType
    88{
     
    1414};
    1515
    16 struct IMAGECTRLINFO
    17 {
     16class ImageControlInfo
     17{
     18public:
    1819    ImageReferenceType::EnumType type;
    1920    std::string path;
    20 };
    21 */
    22 
    23 }}
    24 
    25 
    26 //イメージタイプ
    27 #define IMGTYPE_FILE    0
    28 #define IMGTYPE_RES     1
    29 
    30 struct IMAGECTRLINFO{
    31     int type;
    32     char *path;
    33 };
    34 
    35 class CHILDINFO
    36 {
    37 public:
    38     char *IdName;
     21
     22    bool IsFile() const
     23    {
     24        return ( type == ImageReferenceType::File );
     25    }
     26    bool IsResource() const
     27    {
     28        return ( type == ImageReferenceType::Resource );
     29    }
     30};
     31
     32class WindowInfoBase
     33{
     34public:
     35    const std::string &GetName() const
     36    {
     37        return name;
     38    }
     39    void SetName( const std::string &name )
     40    {
     41        this->name = name;
     42    }
     43
     44    const std::string &GetCaption() const
     45    {
     46        return caption;
     47    }
     48    void SetCaption( const std::string &caption )
     49    {
     50        this->caption = caption;
     51    }
     52
     53    DWORD GetStyle() const
     54    {
     55        return style;
     56    }
     57    void SetStyle( DWORD style )
     58    {
     59        this->style = style;
     60    }
     61    void AddStyle( DWORD style )
     62    {
     63        this->style |= style;
     64    }
     65    void AndStyle( DWORD style )
     66    {
     67        this->style &= style;
     68    }
     69    void DeleteStyle( DWORD style )
     70    {
     71        this->style &= ~style;
     72    }
     73
     74    DWORD GetExStyle() const
     75    {
     76        return exstyle;
     77    }
     78    void SetExStyle( DWORD exstyle )
     79    {
     80        this->exstyle = exstyle;
     81    }
     82    void AddExStyle( DWORD exstyle )
     83    {
     84        this->exstyle |= exstyle;
     85    }
     86
     87private:
     88    std::string name;
     89    std::string caption;
     90    DWORD style;
     91    DWORD exstyle;
     92
     93public:
    3994    POINT pos;
    4095    SIZE size;
    41     char *caption;
    42     DWORD style;
    43     DWORD ExStyle;
     96};
     97
     98class ChildWindowInfo
     99    : public WindowInfoBase
     100{
     101public:
    44102    int Control;
    45103
    46     IMAGECTRLINFO ImageCtrlInfo;
    47 };
     104    ImageControlInfo image;
     105};
     106typedef std::vector<ChildWindowInfo *> ChildWindowInfos;
    48107class WindowInfo
     108    : public WindowInfoBase
    49109{
    50110public:
    51111    WindowInfo()
    52         : caption( NULL )
    53         , MenuID( NULL )
    54         , IconResName( NULL )
    55         , ClassName( NULL )
     112        : WindowInfoBase()
    56113        , CallBackName( NULL )
    57114    {
    58115    }
    59116
    60     void SetName( const std::string &name )
    61     {
    62         this->name = name;
    63     }
    64     const std::string &GetName() const
    65     {
    66         return name;
    67     }
    68 
     117    const std::string &GetClassName() const
     118    {
     119        return className;
     120    }
     121    void SetClassName( const std::string &className )
     122    {
     123        this->className = className;
     124    }
     125
     126    const std::string &GetHandleName() const
     127    {
     128        return handleName;
     129    }
    69130    void SetHandleName( const std::string &handleName )
    70131    {
    71132        this->handleName = handleName;
    72133    }
    73     const std::string &GetHandleName() const
    74     {
    75         return handleName;
     134
     135    const std::string &GetMenuIdName() const
     136    {
     137        return menuIdName;
     138    }
     139    void SetMenuIdName( const std::string &menuIdName )
     140    {
     141        this->menuIdName = menuIdName;
     142    }
     143    bool HasMenu() const
     144    {
     145        return !menuIdName.empty();
     146    }
     147
     148    int GetBackgroundColor() const
     149    {
     150        return backgroundColor;
     151    }
     152    void SetBackgroundColor( int backgroundColor )
     153    {
     154        this->backgroundColor = backgroundColor;
     155    }
     156
     157    const std::string &GetIconResourceName() const
     158    {
     159        return iconResourceName;
     160    }
     161    void SetIconResourceName( const std::string &iconResourceName )
     162    {
     163        this->iconResourceName = iconResourceName;
     164    }
     165    bool HasIcon() const
     166    {
     167        return !iconResourceName.empty();
    76168    }
    77169
    78170    //ウィンドウデータ
    79     POINT pos;
    80     SIZE size;
    81     char *caption;
    82     DWORD style;
    83     DWORD ExStyle;
    84     char *MenuID;
    85     int id;
    86     int bgColor;
    87171    LOGFONT LogFont;
    88     char *IconResName;
    89     char *ClassName;
    90172    char *CallBackName;
    91173    long type;
     
    93175
    94176    //子ウィンドウ管理
    95     std::vector<CHILDINFO *> childWindowInfos;
     177    ChildWindowInfos childWindowInfos;
    96178
    97179    //ツリー項目
     
    99181
    100182private:
    101     std::string name;
     183    std::string className;
    102184    std::string handleName;
     185    std::string menuIdName;
     186    int backgroundColor;
     187    std::string iconResourceName;
    103188};
    104189
     
    133218    }
    134219};
     220
     221
     222}}
Note: See TracChangeset for help on using the changeset viewer.