📄 mininotedialog.cpp
字号:
// MiniNoteDialog.cpp: implementation of the CMiniNoteDialog class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MiniNoteDialog.h"
#include "WindowIDEnum.h"
#include ".\Interface\cWindowManager.h"
#include "cImeEx.h"
#include ".\interface\cTextArea.h"
#include ".\interface\cEditBox.h"
#include ".\interface\cStatic.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMiniNoteDialog::CMiniNoteDialog()
{
m_type = WT_MININOTEDLG;
m_CurMiniNoteMode = -1;
m_SelectedNoteID = 0;
}
CMiniNoteDialog::~CMiniNoteDialog()
{
for(int n=0;n<eMinNoteMode_Max;++n)
{
m_MinNoteCtlListArray[n].RemoveAll();
}
}
void CMiniNoteDialog::Init(LONG x, LONG y, WORD wid, WORD hei, cImage * basicImage, LONG ID)
{
cDialog::Init(x,y,wid,hei,basicImage,ID);
m_type = WT_MININOTEDLG;
}
void CMiniNoteDialog::Linking()
{
m_pRTitleStc = (cStatic*)GetWindowForID(NOTE_MRTITLE); //力格
m_pWTitleStc = (cStatic*)GetWindowForID(NOTE_MWTITLE); //力格
//佬扁
m_pRNoteText = (cTextArea*)GetWindowForID(NOTE_MRNOTETEXTREA);
m_pSender = (cStatic*)GetWindowForID(NOTE_MSENDER); //焊辰捞 :
m_pSenderStc = (cStatic*)GetWindowForID(NOTE_MSENDERSTC); //酒公俺
m_pReplayBtn = (cButton*)GetWindowForID(NOTE_MREPLYBTN);
m_pDeleteBtn = (cButton*)GetWindowForID(NOTE_MDELETEBTN);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pRTitleStc);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pRNoteText);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pSender);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pSenderStc);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pReplayBtn);
m_MinNoteCtlListArray[eMinNoteMode_Read].AddTail(m_pDeleteBtn);
//静扁
m_pWNoteText = (cTextArea*)GetWindowForID(NOTE_MWNOTETEXTREA);
m_pReceiver = (cStatic*)GetWindowForID(NOTE_MRECEIVER); //罐绰捞 :
m_pMReceiverEdit = (cEditBox*)GetWindowForID(NOTE_MRECEIVEREDIT); //酒公俺
m_pMReceiverEdit->SetValidCheck( VCM_CHARNAME );
m_pMReceiverEdit->SetEditText("");
m_pSendOkBtn = (cButton*)GetWindowForID(NOTE_MSENDOKBTN);
m_pSendCancelBtn = (cButton*)GetWindowForID(NOTE_MSENDCANCELBTN);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pWTitleStc);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pWNoteText);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pMReceiverEdit);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pSendOkBtn);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pSendCancelBtn);
m_MinNoteCtlListArray[eMinNoteMode_Write].AddTail(m_pReceiver);
}
void CMiniNoteDialog::ShowMiniNoteMode(int mode)
{
if(m_CurMiniNoteMode == mode)
return;
if(m_CurMiniNoteMode != -1)
{
SetActiveMiniNoteMode(m_CurMiniNoteMode,FALSE);
}
SetActiveMiniNoteMode(mode,TRUE);
m_CurMiniNoteMode = mode;
}
void CMiniNoteDialog::SetMode(int mode)
{
m_CurMiniNoteMode = mode;
}
void CMiniNoteDialog::SetActiveMiniNoteMode(int mode,BOOL bActive)
{
PTRLISTSEARCHSTART(m_MinNoteCtlListArray[mode],cWindow*,pWin)
pWin->SetActive(bActive);
PTRLISTSEARCHEND
}
void CMiniNoteDialog::SetMiniNote(char* Sender, char* Note)
{
m_pSenderStc->SetStaticText(Sender);
m_pRNoteText->SetCaretMoveFirst();
m_pRNoteText->SetScriptText(Note);
m_pMReceiverEdit->SetEditText(Sender);
m_pRNoteText->SetCaretMoveFirst();
m_pWNoteText->SetScriptText(Note);
}
int CMiniNoteDialog::GetCurMode()
{
return m_CurMiniNoteMode;
}
void CMiniNoteDialog::SetActive(BOOL val)
{
if( m_bDisable ) return;
if(val == TRUE)
{
m_pWNoteText->SetScriptText("");
m_pMReceiverEdit->SetEditText("");
}
cDialog::SetActive(val);
}
char* CMiniNoteDialog::GetSenderName()
{
return m_pSenderStc->GetStaticText();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -