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


Ignore:
Timestamp:
May 27, 2008, 9:17:34 PM (16 years ago)
Author:
dai_9181
Message:

・WindowInfoクラスをリファクタリング
・MdiInfoを単純配列からvectorに変更した。

File:
1 edited

Legend:

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

    r624 r625  
    105105};
    106106typedef std::vector<ChildWindowInfo *> ChildWindowInfos;
     107
     108struct WindowType
     109{
     110    enum EnumType
     111    {
     112        Default = 0,
     113        ModalDlg = 1,
     114        ModelessDlg = 3,
     115    };
     116};
     117
    107118class WindowInfo
    108119    : public WindowInfoBase
    109120{
    110121public:
    111     WindowInfo()
    112         : WindowInfoBase()
    113         , CallBackName( NULL )
    114     {
     122
     123    const std::string GetSourceFileName() const
     124    {
     125        return this->GetName() + ".ab";
    115126    }
    116127
     
    124135    }
    125136
    126     const std::string &GetHandleName() const
    127     {
    128         return handleName;
    129     }
    130     void SetHandleName( const std::string &handleName )
    131     {
    132         this->handleName = handleName;
     137    const std::string GetHandleName() const
     138    {
     139        return "h" + this->GetName();
     140    }
     141
     142    const std::string GetCallbackName() const
     143    {
     144        return this->GetName() + "Proc";
    133145    }
    134146
     
    166178    {
    167179        return !iconResourceName.empty();
     180    }
     181
     182    WindowType::EnumType GetType() const
     183    {
     184        return type;
     185    }
     186    void SetType( WindowType::EnumType type )
     187    {
     188        this->type = type;
     189    }
     190    bool IsDefaultWindow() const
     191    {
     192        return ( type == WindowType::Default );
     193    }
     194    bool IsModalDlg() const
     195    {
     196        return ( type == WindowType::ModalDlg );
     197    }
     198    bool IsModelessDlg() const
     199    {
     200        return ( type == WindowType::ModelessDlg );
    168201    }
    169202
    170203    //ウィンドウデータ
    171204    LOGFONT LogFont;
    172     char *CallBackName;
    173     long type;
    174     char *filepath;
    175205
    176206    //子ウィンドウ管理
     
    186216    int backgroundColor;
    187217    std::string iconResourceName;
     218    WindowType::EnumType type;
    188219};
    189220
     
    211242    {
    212243        WindowInfos::iterator it = this->begin();
    213         for( int i=0; i!=index ;i++, it++ )
     244        int i = 0;
     245        while( i < index )
    214246        {
    215             delete *it;
     247            i ++;
     248            it ++;
    216249        }
    217250        this->erase( it );
Note: See TracChangeset for help on using the changeset viewer.