INT_PTR CALLBACK ProtHelpParamDialogProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { ICustButton *iBut = NULL; ProtHelpObject *ph = DLGetWindowLongPtr<ProtHelpObject *>( hDlg); if ( !ph && message != WM_INITDIALOG ) return FALSE; switch ( message ) { case WM_INITDIALOG: ph = (ProtHelpObject *)lParam; DLSetWindowLongPtr( hDlg, ph); SetDlgFont( hDlg, ph->iObjParams->GetAppHFont() ); iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET1)); if( iBut != NULL) { iBut->SetType (CBT_CHECK); iBut->SetHighlightColor (GREEN_WASH); ReleaseICustButton(iBut); } iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET2)); if( iBut != NULL) { iBut->SetType (CBT_CHECK); iBut->SetHighlightColor (GREEN_WASH); ReleaseICustButton(iBut); } return FALSE; case WM_DESTROY: return FALSE; case WM_MOUSEACTIVATE: ph->iObjParams->RealizeParamPanel(); return FALSE; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: ph->iObjParams->RollupMouseMessage(hDlg,message,wParam,lParam); return FALSE; case WM_COMMAND: switch( LOWORD(wParam) ) { case IDC_PROT_PICK_TARGET1: case IDC_PROT_PICK_TARGET2: if(ph->created == FALSE) { iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET1)); if(iBut != NULL) { iBut->SetCheck(FALSE); ReleaseICustButton(iBut); } iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET2)); if(iBut != NULL) { iBut->SetCheck(FALSE); ReleaseICustButton(iBut); } break; } pickCB.ph = ph; pickCB.hDlg = hDlg; if(pickCB.doingPick) ph->iObjParams->SetCommandMode(pickCB.cm); else pickCB.cm = ph->iObjParams->GetCommandMode(); pickCB.which = ((LOWORD(wParam) - IDC_PROT_PICK_TARGET1) > 0); ph->iObjParams->SetPickMode (&pickCB); ph->UpdateUI(ph->iObjParams->GetTime()); ph->iObjParams->RedrawViews (ph->iObjParams->GetTime()); break; } return FALSE; default: return FALSE; } }
INT_PTR CALLBACK TapeHelpParamDialogProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { TapeHelpObject *th = DLGetWindowLongPtr<TapeHelpObject *>( hDlg); if ( !th && message != WM_INITDIALOG ) return FALSE; switch ( message ) { case WM_INITDIALOG: th = (TapeHelpObject *)lParam; DLSetWindowLongPtr( hDlg, th); SetDlgFont( hDlg, th->iObjParams->GetAppHFont() ); th->lengthSpin = GetISpinner(GetDlgItem(hDlg,IDC_LENSPINNER)); th->lengthSpin->SetLimits( MIN_TAPE_LEN, MAX_TAPE_LEN, FALSE ); // alexc - 03.06.09 - increments proportional to the spinner value th->lengthSpin->SetAutoScale(); if(th->specLenState) th->lengthSpin->SetValue( th->GetLength(th->iObjParams->GetTime()), FALSE ); else th->lengthSpin->SetValue( th->lastDist, FALSE ); th->lengthSpin->LinkToEdit( GetDlgItem(hDlg,IDC_LENGTH), EDITTYPE_UNIVERSE ); CheckDlgButton( hDlg, IDC_SPEC_LEN, th->specLenState ); EnableWindow(GetDlgItem(hDlg, IDC_LENGTH), th->specLenState); EnableWindow(GetDlgItem(hDlg, IDC_LENSPINNER), th->specLenState); return FALSE; case WM_DESTROY: ReleaseISpinner( th->lengthSpin ); return FALSE; case CC_SPINNER_BUTTONDOWN: theHold.Begin(); return TRUE; case CC_SPINNER_CHANGE: if (!theHold.Holding()) theHold.Begin(); switch ( LOWORD(wParam) ) { case IDC_LENSPINNER: th->SetLength( th->iObjParams->GetTime(), th->lengthSpin->GetFVal() ); th->lengthSpin->SetKeyBrackets(th->pblock->KeyFrameAtTime(PB_LENGTH,th->iObjParams->GetTime())); th->iObjParams->RedrawViews(th->iObjParams->GetTime(),REDRAW_INTERACTIVE); break; } return TRUE; case WM_CUSTEDIT_ENTER: case CC_SPINNER_BUTTONUP: if (HIWORD(wParam) || message==WM_CUSTEDIT_ENTER) theHold.Accept(GetString(IDS_DS_PARAMCHG)); else theHold.Cancel(); th->iObjParams->RedrawViews(th->iObjParams->GetTime(),REDRAW_END); return TRUE; case WM_MOUSEACTIVATE: th->iObjParams->RealizeParamPanel(); return FALSE; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: th->iObjParams->RollupMouseMessage(hDlg,message,wParam,lParam); return FALSE; case WM_COMMAND: switch( LOWORD(wParam) ) { case IDC_SPEC_LEN: th->SetSpecLen( IsDlgButtonChecked( hDlg, IDC_SPEC_LEN ) ); EnableWindow(GetDlgItem(hDlg, IDC_LENGTH), th->specLenState); EnableWindow(GetDlgItem(hDlg, IDC_LENSPINNER), th->specLenState); th->iObjParams->RedrawViews(th->iObjParams->GetTime()); break; } return FALSE; default: return FALSE; } }