Initial commit
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "StyleSetFormUnit.h"
|
||||
#include "GlobalUnit.h"
|
||||
// ---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TStyleSetForm *StyleSetForm;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
__fastcall TStyleSetForm::TStyleSetForm(TComponent* Owner) : TForm(Owner) {
|
||||
memset(&m_cStyleTypes[0],-1,2);
|
||||
m_iHotItemIndex = -1;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
void __fastcall TStyleSetForm::m_plstStyleSelClickCheck(TObject *Sender) {
|
||||
|
||||
int iHotIndex = m_plstStyleSel->ItemIndex;
|
||||
int iCheckItemCnt = 0;
|
||||
|
||||
if(iHotIndex < 0)
|
||||
return;
|
||||
|
||||
for (int iIndex = 0; iIndex < m_plstStyleSel->Items->Count; iIndex++) {
|
||||
if (m_plstStyleSel->Checked[iIndex])
|
||||
iCheckItemCnt++;
|
||||
}
|
||||
|
||||
if (m_plstStyleSel->Checked[iHotIndex] && iCheckItemCnt > 2) {
|
||||
m_plstStyleSel->Checked[iHotIndex] = false;
|
||||
MessageBox(Handle, L"你已经选择了两种风格", L"提示信息", MB_ICONINFORMATION | MB_OK);
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TStyleSetForm::FormActivate(TObject *Sender) {
|
||||
|
||||
for(int i = 0; i < 24 ; i++)
|
||||
{
|
||||
String strTmpValue = (String)LSZ_STYLTYPES[i];
|
||||
m_plstStyleSel->Items->Add(strTmpValue);
|
||||
if (m_cStyleTypes[0] == i || m_cStyleTypes[1] == i) {
|
||||
m_plstStyleSel->Checked[i] = true;
|
||||
m_plstStyleSel->ItemIndex = i;
|
||||
m_iHotItemIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
void __fastcall TStyleSetForm::btnSaveHarmClick(TObject *Sender)
|
||||
{
|
||||
for (int i = 0,index = 0; i < m_plstStyleSel->Items->Count; i++) {
|
||||
if (m_plstStyleSel->Checked[i] && index < 2) {
|
||||
m_cStyleTypes[index++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
ModalResult = mrOk;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user