void __fastcall TIntMinerField::MouseUpHandler(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y) { int ACol, ARow; SetCaptureControl(NULL); MouseToCell(X, Y, ACol, ARow); if((ACol == - 1) || (ARow == -1)) return; if(((Shift == (TShiftState() << ssLeft)) && (Button == mbRight)) || ((Shift == (TShiftState() << ssRight)) && (Button == mbLeft)) || (Button == mbMiddle)) { FireImageChanged(imSmile); FSurprised = false; UnpressAndInvalidate(); if(CellState[ACol][ARow].CellState == csOpened) FireMinerFieldEvent(ACol, ARow, meCheckSurround); return; }; if(Button == mbLeft) { FireImageChanged(imSmile); FSurprised = false; if(IsExistsInArray(FPressedCells, ACol, ARow)) { // BeginUpdate(); FireMinerFieldEvent(ACol, ARow, meOpenCell); // EndUpdate(); UnpressAndInvalidate(); }; return; }; if(Button == mbRight) UnpressAndInvalidate(); }
void __fastcall TIntMinerField::MouseDownHandler(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y) { int ACol, ARow; SetCaptureControl(FGrid->Views[0]->Site); MouseToCell(X, Y, ACol, ARow); if((ACol == - 1) || (ARow == -1)) return; if((Shift == (TShiftState() << ssLeft << ssRight)) || (Shift == (TShiftState() << ssLeft << ssRight)) || (Shift == (TShiftState() << ssMiddle)) || (Shift == (TShiftState() << ssLeft << ssMiddle)) || (Shift == (TShiftState() << ssRight << ssMiddle))) { FireImageChanged(imAstonisment); FSurprised = true; for(int i=-1; i <=1; i++) for(int j=-1; j <=1; j++) if(CheckFieldBounds(ACol+i, ARow+j) && ( (CellState[ACol+i][ARow+j].CellState == csClosed) || (CellState[ACol+i][ARow+j].CellState == csQuestionMarked))) { AddPressedCell(ACol+i, ARow+j); InvalidateCell(ACol+i, ARow+j); }; return; }; if(Button == mbLeft) { FireImageChanged(imAstonisment); FSurprised = true; if((CellState[ACol][ARow].CellState == csClosed) || (CellState[ACol][ARow].CellState == csQuestionMarked)) { AddPressedCell(ACol, ARow); InvalidateCell(ACol, ARow); }; return; }; if(Button == mbRight) { if(CellState[ACol][ARow].CellState == csOpened) return; if(CellState[ACol][ARow].CellState == csClosed) { FireMinerFieldEvent(ACol, ARow, meBombMarkCell); FireSetMineCountEvent(mcDecMineCount); } else if((CellState[ACol][ARow].CellState == csBombMarked) && FQuestionMarkCell) { FireMinerFieldEvent(ACol, ARow, meQuestionMarkCell); FireSetMineCountEvent(mcIncMineCount); } else { FireMinerFieldEvent(ACol, ARow, meCloseCell); if(!FQuestionMarkCell) FireSetMineCountEvent(mcIncMineCount); }; InvalidateCell(ACol, ARow); }; }
//--------------------------------------------------------------------------- void __fastcall TFormClients::FormShow(TObject *Sender) { ListBoxClientsInfo->Items->Clear(); Left=1;Top=1; if(EditPHONE->Text.Length()>0){ EditPHONE->Tag=1; EditNAME->Tag=0; EditKeyUp(Sender, 0, TShiftState()); } else{ EditPHONE->Tag=0; EditNAME->Tag=1; if(FIBDataSetClients->Active)FIBDataSetClients->Close(); FIBDataSetClients->SQLs->SelectSQL->Clear(); FIBDataSetClients->SQLs->SelectSQL->Add("SELECT UNIQC, CLT_NAME, CLT_INFO, CLT_ADRESS, CLT_TYPE, CLT_PHONE, CLT_COUNTER, CLT_DISCOUNT FROM CLIENTS where uniqc > 0"); for(int n=0;n<DBGridEhClients->Columns->Count;n++){ if (DBGridEhClients->Columns->Items[n]->Title->SortMarker==smDownEh){ FIBDataSetClients->SQLs->SelectSQL->Add("order by "+DBGridEhClients->Columns->Items[n]->FieldName); break; } else if (DBGridEhClients->Columns->Items[n]->Title->SortMarker==smUpEh){ FIBDataSetClients->SQLs->SelectSQL->Add("order by "+DBGridEhClients->Columns->Items[n]->FieldName+" desc"); break; } } FIBDataSetClients->Open(); EditNAME->SetFocus(); } }
STDMETHODIMP TCCD1Impl::Foto() { Historico->Mhistory->Lines->Add(" Foto CCD1"); Form1->IFotoMouseDown(NULL, (TMouseButton)NULL, TShiftState(), 0, 0); return S_OK; }
//=========================================================================== void __fastcall TfrmSetupAngleNet::tbAddTickClick(TObject *Sender) { CurAngleTick = NULL; // ------ Edit1->Text = "0.0"; CheckBox1->Checked = true; // ------ Edit1KeyDown(Sender, 0, TShiftState()); }
/* Starts an exposure. Use ImageReady to check when the exposure is complete. An error occurs if the exposure cannot be started. If no filter is specified, or if a negative number is specified, the filter wheel remains at its previous position. - Double Duration – Duration of exposure in seconds - Short Light 1 for light frame, 0 for dark frame (ignored if no shutter) - Short Filter (optional) Index of filter to use; first filter is 0 (ignored if no filter wheel) Returns: Boolean True if successful */ STDMETHODIMP TCCD1Impl::Expose(double Duration, int Light, int Filter) { Historico->Mhistory->Lines->Add ("Exponiendo " + (AnsiString)(Duration) + "sg, Filtro " + (AnsiString)(Filter)); Form1->Esg->Text = (int)(Duration); Form1->CBimagen->ItemIndex = Light; Filtro->mover_rueda(Filter); Form1->IFotoMouseDown(NULL, (TMouseButton)NULL, TShiftState(), 0, 0); return S_OK; }
//--------------------------------------------------------------------------- void __fastcall TFormMain::TimerDoerTimer(TObject *Sender) { if (mNextRobotMove.x!=-1 && mNextRobotMove.y!=-1) { //Move in range? assert(mNextRobotMove.x >= 0 && mNextRobotMove.x < mMaxx); assert(mNextRobotMove.y >= 0 && mNextRobotMove.y < mMaxy); //Move relevant? assert(mBlocks[mNextRobotMove.x][mNextRobotMove.y] == NoPlayer); TimerThinker->Enabled = false; FormMouseDown(TimerDoer,TMouseButton(), TShiftState(), mNextRobotMove.x*50, mNextRobotMove.y*50); mNextRobotMove.x=-1; mNextRobotMove.y=-1; } }
void __fastcall TFwCalcMainDlg::CMDialogKey(TWMKey &key) { switch(key.CharCode) { case VK_PRIOR: case VK_UP: m_engine->ProcessKey(TShiftState(), VK_UP); break; case VK_NEXT: case VK_DOWN: m_engine->ProcessKey(TShiftState(), VK_DOWN); break; case VK_END: m_engine->ProcessKey(TShiftState(), VK_END); break; case VK_HOME: m_engine->ProcessKey(TShiftState(), VK_HOME); break; } }
void __fastcall TIntMinerField::MouseMoveHandler(System::TObject* Sender, Classes::TShiftState Shift, int X, int Y) { int ACol, ARow; MouseToCell(X, Y, ACol, ARow); if((ACol == - 1) || (ARow == -1)) { if(FPressedCells.Length != 0) UnpressAndInvalidate(); if(FSurprised) { FireImageChanged(imSmile); FSurprised = false; }; return; }; if(Shift == (TShiftState() << ssLeft)) { if((CellState[ACol][ARow].CellState == csOpened)) { if(FPressedCells.Length != 0) { UnpressAndInvalidate(); InvalidateCell(ACol, ARow); }; } else if((CellState[ACol][ARow].CellState == csClosed) || (CellState[ACol][ARow].CellState == csQuestionMarked)) if(!IsExistsInArray(FPressedCells, ACol, ARow)) { UnpressAndInvalidate(); AddPressedCell(ACol, ARow); InvalidateCell(ACol, ARow); } return; } if((Shift == (TShiftState() << ssLeft << ssRight)) || (Shift == (TShiftState() << ssLeft << ssRight)) || (Shift == (TShiftState() << ssMiddle)) || (Shift == (TShiftState() << ssLeft << ssMiddle)) || (Shift == (TShiftState() << ssRight << ssMiddle))) { UnpressAndInvalidate(); for(int i=-1; i<=1; i++) for(int j=-1; j<=1; j++) if(CheckFieldBounds(ACol+i, ARow+j) && ((CellState[ACol+i][ARow+j].CellState == csClosed) || (CellState[ACol+i][ARow+j].CellState == csQuestionMarked))) { AddPressedCell(ACol+i, ARow+j); InvalidateCell(ACol+i, ARow+j); } } }
void __fastcall TfMain::sbBackClick(TObject *Sender) { unsigned short Key = VK_PRIOR; fMain->KeyDown(Key, TShiftState()); //Page up }
//---------------------------------------------------------------------------- //Menus.hpp //メニューショートカットの仮想キーコードとシフト状態を返す void ShortCutToKey( TShortCut ShortCut, Word & Key, TShiftState &Shift ) { Key = 0; Shift = TShiftState(); }
void __fastcall TFwCalcMainDlg::BackButtonClick(TObject *Sender) { m_engine->ProcessKey(TShiftState(), VK_BACK); }
void __fastcall TFwCalcMainDlg::CLRButtonClick(TObject *Sender) { m_engine->ProcessKey(TShiftState(), VK_DELETE); }
void __fastcall TFwCalcMainDlg::EnterButtonClick(TObject *Sender) { m_engine->ProcessKey(TShiftState(), VK_RETURN); }