void CDialogCoord::OnBnClickedBtnLeft() { --px_; px_ = std::max(px_, 0); UpdateWnd(); }
void CDialogCoord::OnBnClickedBtnUp() { --py_; py_ = std::max(py_, 0); UpdateWnd(); }
void CDialogCoord::OnBnClickedBtnRight() { ++px_; px_ = std::min(px_, imginput_.cols-1); UpdateWnd(); }
void CDialogCoord::OnBnClickedBtnDown() { ++py_; py_ = std::min(py_, imginput_.rows-1); UpdateWnd(); }
void CMonitorWnd::SetActivePage(CWnd *pWnd, BOOL bRepaint) { if(pWnd == NULL || !IsWindow(pWnd->m_hWnd)) { return; } POSITION pos = m_PageList.Find(pWnd); if(pos == NULL) { TRACE("__This Window is not a member of container, the operation will terminate.\n"); return; } if(m_bDrawActive) { DrawActivePage(FALSE); } m_bDrawActive = TRUE; m_pActivePage = pWnd; if(bRepaint) { UpdateWnd(); } if(m_bDrawActive) { DrawActivePage(TRUE); } }
void CMonitorWnd::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here UpdateWnd(); // Do not call CWnd::OnPaint() for painting messages }
BOOL CDialogCoord::OnInitDialog() { CDialog::OnInitDialog(); UpdateWnd(); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
static void status_OnSize( HWND hwnd, UINT state, int cx, int cy) { struct statusWindowData *theData; theData = (struct statusWindowData *) GetWindowLongPtr(hwnd,GWLP_USERDATA); if (theData == NULL) { return; } theData->noLines = cy / theData->lineSize; UpdateWnd(hwnd); FORWARD_WM_SIZE(hwnd,state,cx,cy,DefMDIChildProc); }
static void UpdateStatusContent( HWND hwnd) { struct statusWindowData *theData; if (hwnd == NULL) return; if (! IsWindowVisible(hwnd)) return; theData = (struct statusWindowData *) GetWindowLongPtr(hwnd,GWLP_USERDATA); if (theData == NULL) return; if (! (*theData->getChanged)(GlobalEnv)) return; (*theData->setChanged)(GlobalEnv,FALSE); theData->lastLine = (*theData->getCount)(GlobalEnv); UpdateStatusWndTitle(hwnd); UpdateWnd(hwnd); }
/////////////////////////////////////////////////// // call this function to set a page to be active // page. void CBSWndContainer::SetActivePage(CWnd *pWnd, BOOL bRepaint) { // check parameter if( !pWnd || !IsWindow(pWnd->m_hWnd) ) return; // if pWnd is the Active Page, return if( m_pActivePage==pWnd ) return; // check list POSITION pos=m_PageList.Find(pWnd); if(pos==NULL) { TRACE("__This Window is not a member of container, the operation will terminate.\n"); return; } if(bRepaint) UpdateWnd(); if( m_bDrawActive ) DrawActivePage(FALSE); m_pActivePage=pWnd; if( m_bDrawActive ) DrawActivePage(TRUE); }
long FAR PASCAL StatusWndProc( HWND hWnd, unsigned message, WPARAM wParam, LONG lParam) { extern SCREEN WinFact, WinAgenda, WinInst, WinGlobal, WinFocus; SCREEN *Window; void (*GetPPForm)(char*,int,void*) = NULL; void *(*GetNextValue)(void*) = NULL; /*---------------------------------------------------+ | Determine which Window the message is intended for | +---------------------------------------------------*/ #if DEFTEMPLATE_CONSTRUCT if ( hWnd == WinFact.hWnd ) { Window = &WinFact; GetNextValue = GetNextFactInScope; GetPPForm = GetFactPPForm; } #endif #if OBJECT_SYSTEM if ( hWnd == WinInst.hWnd ) { Window = &WinInst; GetNextValue = GetNextInstanceInScope; GetPPForm = GetInstancePPForm; } #endif #if DEFGLOBAL_CONSTRUCT if ( hWnd == WinGlobal.hWnd ) { Window = &WinGlobal; GetNextValue = GetNextDefglobalInScope; GetPPForm = GetDefglobalValueForm; } #endif #if DEFRULE_CONSTRUCT if ( hWnd == WinAgenda.hWnd ) { Window = &WinAgenda; GetNextValue = GetNextActivation; GetPPForm = GetActivationPPForm; } if ( hWnd == WinFocus.hWnd ) { Window = &WinFocus; GetNextValue = GetNextFocus; GetPPForm = GetFocusPPForm; } #endif switch (message) { case WM_VSCROLL: return ( ProcessScrollMsg ( Window, LOWORD(wParam), lParam, SB_VERT )); case WM_HSCROLL: return ( ProcessScrollMsg ( Window, LOWORD(wParam), lParam, SB_HORZ )); case WM_SIZE: { /*-----------------------+ | Window Changes in Size | +-----------------------*/ (*Window).NoLines = HIWORD (lParam) / (*Window).LineSize; UpdateWnd ( Window ); break; } case WM_KEYDOWN: { /*----------------------------------------------------+ | Key input was detected in window send to Dialog Wnd | +----------------------------------------------------*/ extern SCREEN WinDialog; PostMessage ( WinDialog.hWnd, message, wParam, lParam); SetFocus ( WinDialog.hWnd ); break; } case WM_PAINT: { /*---------------------+ | Screen Update Needed | +---------------------*/ PAINTSTRUCT ps; HDC hDC; BeginPaint (hWnd, (LPPAINTSTRUCT)&ps); hDC = ps.hdc; SetMapMode (hDC, MM_TEXT); RedrawScreen ( Window, GetPPForm, GetNextValue, hDC ); ValidateRect (hWnd, (LPRECT)NULL); EndPaint (hWnd, (LPPAINTSTRUCT)&ps); return (TRUE); } default: return (DefWindowProc(hWnd, message, wParam, lParam)); } return ( TRUE ); }
void UpdateStatus ( void ) { extern SCREEN WinFact, WinAgenda, WinGlobal, WinInst, WinDialog; static long lastModuleIndex = -1; extern long ModuleChangeIndex; if ( lastModuleIndex != ModuleChangeIndex ) { #if DEFRULE_CONSTRUCT SetFocusChanged (CLIPS_TRUE); SetAgendaChanged (CLIPS_TRUE); #endif #if DEFTEMPLATE_CONSTRUCT SetFactListChanged (CLIPS_TRUE); #endif #if OBJECT_SYSTEM SetInstancesChanged (CLIPS_TRUE); #endif #if DEFGLOBAL_CONSTRUCT SetGlobalsChanged (CLIPS_TRUE); #endif lastModuleIndex = ModuleChangeIndex; } #if DEFRULE_CONSTRUCT /*------------------------+ | Update the Focus Window | +------------------------*/ if (IsWindowVisible(WinFocus.hWnd)) { if (GetFocusChanged()) { SetFocusChanged(CLIPS_FALSE); WinFocus.LastLine = (int) CountFocus(); UpdateWnd ( &WinFocus ); } } /*-------------------------+ | Update the Agenda Window | +-------------------------*/ if (IsWindowVisible(WinAgenda.hWnd)) { if ( GetAgendaChanged() ) { SetAgendaChanged ( CLIPS_FALSE ); WinAgenda.LastLine = (int) GetNumberOfActivations(); UpdateStatusWndTitle(WinAgenda.hWnd, "Agenda"); UpdateWnd ( &WinAgenda ); } } #endif #if DEFTEMPLATE_CONSTRUCT /*-----------------------+ | Update the Fact Window | +-----------------------*/ if (IsWindowVisible(WinFact.hWnd)) { if ( GetFactListChanged()) { SetFactListChanged ( CLIPS_FALSE ); WinFact.LastLine = CountFacts(); UpdateStatusWndTitle(WinFact.hWnd, "Facts"); UpdateWnd ( &WinFact ); } } #endif #if OBJECT_SYSTEM /*---------------------------+ | Update the Instance Window | +---------------------------*/ if (IsWindowVisible(WinInst.hWnd)) { if (GetInstancesChanged()) { SetInstancesChanged (CLIPS_FALSE); UpdateStatusWndTitle(WinInst.hWnd, "Instances"); WinInst.LastLine = CountInstances(); UpdateWnd ( &WinInst ); } } #endif #if DEFGLOBAL_CONSTRUCT /*--------------------------+ | Update the Globals Window | +--------------------------*/ if (IsWindowVisible(WinGlobal.hWnd)) { if (GetGlobalsChanged()) { SetGlobalsChanged(CLIPS_FALSE); UpdateStatusWndTitle(WinGlobal.hWnd, "Globals"); WinGlobal.LastLine = CountDefglobals(); UpdateWnd ( &WinGlobal ); } } #endif }