OSDN Git Service

航路管理画面を実装。
[gvonavish/GVONavish.git] / GVONavish / GVONavish / GVOShipRouteManageView.h
1 #pragma once
2 #include "GVONoncopyable.h"
3 #include "GVOShipRouteList.h"
4
5
6
7 //!@brief \8dq\98H\8aÇ\97\9d\83r\83\85\81[
8 class GVOShipRouteManageView : private GVONoncopyable, public IGVOShipRouteListObserver {
9 private:
10         enum ColumnIndex {
11                 k_ColumnIndex_StartPoint,
12                 k_ColumnIndex_EndPoint,
13         };
14         enum IconIndex {
15                 k_IconIndex_Blank,
16                 k_IconIndex_Star,
17         };
18         HWND m_hwnd = nullptr;
19         GVOShipRouteList * m_routeList = nullptr;
20
21         HWND m_listViewCtrl = nullptr;
22         int m_selectionIndex = -1;
23         GVOShipRoute * m_selectedRoute = nullptr;
24
25         size_t m_visibleCount = 50;
26
27 public:
28         GVOShipRouteManageView() = default;
29         ~GVOShipRouteManageView();
30
31         bool setup( GVOShipRouteList & shipRouteList );
32         void teardown();
33
34         void activate()
35         {
36                 ::ShowWindow( m_hwnd, SW_SHOWNORMAL );
37                 ::SetForegroundWindow( m_hwnd );
38         }
39
40         virtual void onShipRouteListAddRoute( GVOShipRoute & shipRoute ) override;
41         virtual void onShipRouteListUpdateRoute( GVOShipRoute & shipRoute ) override;
42         virtual void onShipRouteListRemoveItem( GVOShipRoute & shipRoute ) override;
43         virtual void onShipRouteListRemoveAllItems() override;
44 private:
45         static BOOL CALLBACK dlgProcThunk( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp );
46         BOOL CALLBACK dlgProc( UINT msg, WPARAM wp, LPARAM lp );
47         void onCommand(WORD eventCode, WORD cmdId, HANDLE ctrl);
48         void onNotify( LPNMHDR nmh );
49         void setupRouteList();
50         void updateVisibleListItemCount();
51 };
52