Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
itagagaki committed Dec 5, 2023
1 parent 8356dac commit 429cc7c
Show file tree
Hide file tree
Showing 30 changed files with 482 additions and 408 deletions.
3 changes: 2 additions & 1 deletion AboutDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class CAboutDlg : public CDialog
{
public:
CAboutDlg();

private:
enum { IDD = IDD_ABOUTBOX };

protected:
virtual void DoDataExchange(CDataExchange* pDX);

protected:
DECLARE_MESSAGE_MAP()
};
109 changes: 61 additions & 48 deletions Charu3.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,42 +94,28 @@ class CCharu3App : public CWinApp
CCharu3App();
~CCharu3App();

void popupTreeWindow(POINT pos, bool keepSelection, HTREEITEM hOpenItem = NULL);
void closeTreeWindow(int nRet);
void pasteData(CString strPaste, COPYPASTE_KEY key, HWND hWnd);
void execData(CString strPaste, COPYPASTE_KEY key, HTREEITEM hTargetItem, HWND hWnd);
void execKeyMacro(CString strKeyMacro);

CString getSelectString(COPYPASTE_KEY key, HWND hWnd = NULL);
void keyUpDown(UINT uMod, UINT uVKCode, int nFlag);
void keyUpDownC2(UINT uMod, UINT uVKCode, int nFlag);
void keyUpDownMessage(UINT uMod, UINT uVKCode, int nFlag, HWND hWnd);

CString convertMacro(STRING_DATA* SourceData, CString strSelect, CString strClip, CString strSoftName);
HWND GetAppWnd() { return m_hSelfWnd; }
int GetPhase() { return m_nPhase; }

HWND getAppWnd() { return m_hSelfWnd; }
bool isCloseKey() { return m_isCloseKey; }
void popupTreeWinMC(HWND hForeground);

void Record(CString text);
void toggleStockMode();
bool getStockSW() { return m_isStockMode; }
int getPhase() { return m_nPhase; }
void fifoClipboard();
void resetTreeDialog();

bool SelectFile();
CString NewFile();
void SaveData();
CString NewFile(); // TODO: Should be a unitlity

void RedrawDataTreeView() {
if (m_pTreeDlg->IsWindowVisible()) {
m_pTreeDlg->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE);
}
}

CMyTreeDialog* m_pTreeDlg;
CInit m_ini;
CClipBoard m_clipboard;
CCharu3Tree* m_pTree;
CMainFrame* m_pMainFrame;
COPYPASTE_KEY m_keySet;
FOCUS_INFO m_focusInfo;
HWND m_hSelfWnd;

// オーバーライド
// ClassWizard は仮想関数のオーバーライドを生成します。
Expand All @@ -140,33 +126,47 @@ class CCharu3App : public CWinApp
virtual int ExitInstance();
//}}AFX_VIRTUAL

// インプリメンテーション

public:
//{{AFX_MSG(CCharu3App)
afx_msg void OnExit();
afx_msg void OnAbout();
afx_msg void OnIssues();
afx_msg void OnDiscussions();
afx_msg void OnWiki();
afx_msg void OnOption();
afx_msg void OnAddData();
afx_msg void OnChangData();
afx_msg void OnExport();
afx_msg void OnStockStop();
afx_msg void OnResetTree();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// インプリメンテーション
private:
void registerHotkeys();
void unregisterHotkeys();
void registerAdditionalHotkeys();
void unregisterAdditionalHotkeys();

protected:
void getPopupPos(POINT* pPos, int nPosType);
void adjustLocation(POINT* pos);
void convHotKeyConf(CString strKey, UINT* pMod, UINT* pVK, bool* isDoubleClick);
int getKeycode(TCHAR* szKeyName, bool scanLayout);
bool setAppendKeyInit(HWND hTopWindow, COPYPASTE_KEY* keySet);

void getPopupPos(POINT* pPos, int nPosType);
void adjustLocation(POINT* pos);

void popupTreeWindow(POINT pos, bool keepSelection, HTREEITEM hOpenItem = NULL);
void closeTreeWindow(int nRet);

void pasteData(CString strPaste, COPYPASTE_KEY key, HWND hWnd);
void execData(CString strPaste, COPYPASTE_KEY key, HTREEITEM hTargetItem, HWND hWnd);
void execKeyMacro(CString strKeyMacro);

void playHotItem(int nTarget);
void playData(STRING_DATA data, CString strClip, CString strSelect, bool isPaste, bool isChange = true);

CString getSelectString(COPYPASTE_KEY key, HWND hWnd = NULL);
void keyUpDown(UINT uMod, UINT uVKCode, int nFlag);
void keyUpDownC2(UINT uMod, UINT uVKCode, int nFlag);
void keyUpDownMessage(UINT uMod, UINT uVKCode, int nFlag, HWND hWnd);

CString convertMacro(STRING_DATA* SourceData, CString strSelect, CString strClip, CString strSoftName);

void fifoClipboard();
void resetTreeDialog();

bool SelectFile();
void SaveData();

HWND m_hSelfWnd;
CMyTreeDialog* m_pTreeDlg;
COPYPASTE_KEY m_keySet;

HTREEITEM m_hSelectItemBkup;
DWORD m_dwDoubleKeyPopTime, m_dwDoubleKeyFifoTime;

Expand All @@ -182,11 +182,24 @@ class CCharu3App : public CWinApp
int m_nPhase;
CString m_strSavedClipboard, m_strPreviousStocked, m_strPreviousRecordedToHistory;

private:
void registerHotkeys();
void unregisterHotkeys();
void registerAdditionalHotkeys();
void unregisterAdditionalHotkeys();
// 生成されたメッセージ マップ関数
public:
//{{AFX_MSG(CCharu3App)
afx_msg void OnOption();
afx_msg void OnExit();
protected:
afx_msg void OnAbout();
afx_msg void OnIssues();
afx_msg void OnDiscussions();
afx_msg void OnWiki();
afx_msg void OnAddData();
afx_msg void OnChangData();
afx_msg void OnExport();
afx_msg void OnStockStop();
afx_msg void OnResetTree();
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};

extern CCharu3App theApp;
Expand Down
Loading

0 comments on commit 429cc7c

Please sign in to comment.