Ejemplo n.º 1
0
void InstallerWindow::OnDocumentComplete()
{
	if (get(m_configuration) != NULL)
	{
		OnShow();
	}
}
Ejemplo n.º 2
0
void CXTPPopupControl::OnExpanding(BOOL bUpdateCurrent)
{
	//set Expanding state
	SetPopupState(xtpPopupStateExpanding);

	CPoint ptPopup = GetPopupPos();

	//reinit target rect
	m_stateTarget.rcPopup = CRect(CPoint(ptPopup.x - m_szPopup.cx, ptPopup.y - m_szPopup.cy), m_szPopup);
	m_stateTarget.nTransparency = m_nTransparency;

	//if updating flag is set
	if (bUpdateCurrent)
	{
		//reinit curent state object
		m_stateCurrent = m_stateTarget;

		//if no-animation mode
		if (m_popupAnimation == xtpPopupAnimationNone || m_uAnimationDelay <= 0)
		{
			//update view
			UpdateState(TRUE);
			//show popup
			OnShow();
			//return from proc
			return;
		}
		//if Fage animation mode
		else if (m_popupAnimation == xtpPopupAnimationFade)
		{
			//set target transparensy value
			m_stateCurrent.nTransparency = 0;
		}
		//if Slide animation mode
		if (m_popupAnimation == xtpPopupAnimationSlide)
		{
			//set rectangular of target
			m_stateCurrent.rcPopup = CRect(ptPopup.x - m_szPopup.cx, ptPopup.y, ptPopup.x, ptPopup.y);
		}
		//if Unfold animation mode
		else if (m_popupAnimation == xtpPopupAnimationUnfold)
		{
			//set rectangular of target
			m_stateCurrent.rcPopup = CRect(ptPopup, CSize(0));
		}
		//calc step
		m_nStep = max(1, m_uAnimationDelay/m_nAnimationInterval);
	}
	else
	{
		//calc step
		m_nStep = max(1, m_uAnimationDelay/m_nAnimationInterval - m_nStep);
	}

	//set expanding timer
	SetTimer(TID_EXPANDING, m_nAnimationInterval, NULL);

	//update view state
	UpdateState(TRUE);
}
Ejemplo n.º 3
0
SectionBar::SectionBar( Control& parent ) :
   Control( parent ),
   m_section( nullptr )
{
   SetObjectId( "IWSectionBar" );

   SetFocusStyle( FocusStyle::NoFocus );

   SetSizer( Global_Sizer );

   Global_Sizer.AddSpacing( 1 );
   Global_Sizer.Add( Title_Sizer );
   Global_Sizer.AddSpacing( 1 );

   Title_Sizer.AddSpacing( 4 );
   Title_Sizer.Add( Title_Label );
   Title_Sizer.AddStretch();
   Title_Sizer.Add( Title_ToolButton );
   Title_Sizer.AddSpacing( 4 );

   Title_Label.SetText( String( 'M' ) );
   Title_Label.SetTextAlignment( TextAlign::Left|TextAlign::VertCenter );
   Title_Label.SetText( String() );

   Title_ToolButton.SetIcon( Bitmap( ScaledResource( contract_icon ) ) );
   Title_ToolButton.SetScaledFixedSize( 17, 17 );
   Title_ToolButton.SetFocusStyle( FocusStyle::NoFocus );
   Title_ToolButton.OnClick( (Button::click_event_handler)&SectionBar::ButtonClick, *this );

   AdjustToContents();
   SetFixedHeight();

   OnMousePress( (Control::mouse_button_event_handler)&SectionBar::MousePress, *this );
   OnShow( (Control::event_handler)&SectionBar::ControlShow, *this );
}
Ejemplo n.º 4
0
void CXTPPopupControl::OnLButtonDown(UINT nFlags, CPoint point)
{

	if ((GetPopupState() == xtpPopupStateExpanding) && !m_bSplashScreenMode)
	{
		m_nStep = 0;
		Animate(0);
		//kill timer event
		KillTimer(TID_EXPANDING);
		OnShow();
	}

	//test point to pressed controll
	CXTPPopupItem* pPressed = HitTest(point);

	if (m_bAllowMove && (!pPressed || (!pPressed->GetID() && !pPressed->IsButton() && (pPressed->GetCaption().IsEmpty() || !pPressed->IsHyperLink()))))
	{
		TrackMove();
		return;
	}

	//if success test
	if (pPressed)
	{
		m_pPressed = pPressed;
		//set capture
		SetCapture();
		//redraw all valide controls
		RedrawControl();
	}


	CWnd::OnLButtonDown(nFlags, point);
}
void EDA_DRAW_PANEL_GAL::onShowTimer( wxTimerEvent& aEvent )
{
    if( m_gal && m_gal->IsVisible() )
    {
        m_onShowTimer.Stop();
        OnShow();
    }
}
Ejemplo n.º 6
0
//---------------------------------------------------------------------------
void TSymbolDialog::DoShow()
{
  FSymbolFrm->Button2->OnClick = Button2Click;
  FSymbolFrm->OnClose = FormClose;
  FSymbolFrm->ComboBox1->ItemIndex = FSymbolFrm->ComboBox1->Items->IndexOf(FontName);
  if(OnShow)
    OnShow(this);
}
Ejemplo n.º 7
0
LRESULT TaskSortFieldSelector::WndProc(unsigned int msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
	case WM_ERASEBKGND:
		return OnEraseBackground(wParam);
	case WM_KEYDOWN:
		if(wParam == VK_ESCAPE)
		{
			ShowWindow(m_hwnd, SW_HIDE);
		}
		break;
	case WM_CREATE:
        OnCreate();
        break;
	case WM_MOUSEMOVE:
		OnMouseMove(wParam, lParam);
		break;
	case WM_MOUSELEAVE:
		if(hilite > -1)
		{
			hilite = -1;
			InvalidateRect(m_hwnd, NULL, FALSE);
		}
		m_bTrackMouse = false;
		break;
	case WM_LBUTTONDOWN:
		OnMouseLDown(wParam, lParam);
		break;
	case WM_LBUTTONUP:
		OnMouseLUp(wParam, lParam);
		break;
	case WM_SHOWWINDOW:
		OnShow(wParam, lParam);
		break;
	case WM_PRINTCLIENT:
		{
			RECT r = { 0, 0, 0, 0 };
			GetClientRect(m_hwnd, &r);
            PaintBuffer(m_hwnd, reinterpret_cast<HDC>(wParam), r.right, r.bottom);
		}
		break;
/*	case WM_VSCROLL:
		OnScroll(wParam, lParam);
		break;
    case WM_SIZE:
        OnSize();
        break;
    case WM_DESTROY:
        OnDestroy();
        break;
    case WM_CLOSE:
        if(m_ref > 2)break; */
    default:
        return DefWindowProc(m_hwnd, msg, wParam, lParam);
    }
    return 0;
}
Ejemplo n.º 8
0
void qtDLGTrace::showEvent(QShowEvent * event)
{
	if(m_traceData.count() <= 0) return;

	m_maxRows = (tblTraceLog->verticalHeader()->height() / 12) - 1;

	scrollTrace->setValue(0);

	OnShow(0);
}
Ejemplo n.º 9
0
int TColorSchemeToolbarFrame::OnMessage(int Msg,DWORD wParam,DWORD lParam,IDCMapObject* pSender)
{
    switch (Msg)
    {
    case DCMM_DATA_CHANGED:
        OnShow();
        break;
    }
    return 0;
}
Ejemplo n.º 10
0
void CCWidget::OnShow(bool bVisible){
	for(int i=m_Children.GetCount()-1; i>=0; i--){
		CCWidget* pCurWnd = m_Children.Get(i);
		if(pCurWnd->m_bVisible==true) pCurWnd->OnShow(bVisible);
	}

	if(bVisible==true) OnShow();
	else OnHide();

	if(bVisible==false && CCWidget::m_pFocusedWidget==this) ReleaseFocus();
}
Ejemplo n.º 11
0
//------------------------------------------------------------------------
BOOL	CEGForm::OnMessage( HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	switch( uMsg )
	{

	case	WM_NOTIFY:
		{
			CEGBaseWnd	*	pWnd = GetWndObject( ((NMHDR*)lParam)->hwndFrom );
			if( pWnd != NULL )
			{
				pWnd->OnNotify( (NMHDR*)lParam );
			}
		}
		break;
	case	WM_DRAWITEM:
		{
			LPDRAWITEMSTRUCT		pDrawItemStruct = (LPDRAWITEMSTRUCT)lParam;
			UINT	id = (UINT)wParam;
			CEGBaseWnd * pWnd = GetWndObject( pDrawItemStruct->hwndItem );
			if( pWnd != NULL )
			{
				return pWnd->OnDrawItem( pDrawItemStruct );
			}
		}
		break;
	case	WM_SHOWWINDOW:
		{
			OnShow();
		}
		break;
	case	WM_CLOSE:
		{
			if( !OnClose() )
			{
				m_hResult = 0;
				return TRUE;
			}
			PostQuitMessage(0);
			return FALSE;
		}
		break;
	case	WM_COMMAND:
		{
			OnCommand( LOWORD(wParam) );
		}
		break;
	}
	return FALSE;
}
Ejemplo n.º 12
0
void qtDLGTrace::wheelEvent(QWheelEvent *event)
{
	QWheelEvent *pWheel = (QWheelEvent*)event;

	if(pWheel->delta() > 0)
	{
		scrollTrace->setValue(scrollTrace->value() - 1);
	}
	else
	{
		scrollTrace->setValue(scrollTrace->value() + 1);
	}

	OnShow(scrollTrace->value());
}
Ejemplo n.º 13
0
__fastcall TWorkersSettings::TWorkersSettings(TComponent* Owner,cSQL *db,const int&_LUser)
    : TFrame(Owner),DB(db),LUser(_LUser)
{
	sgGroups->Cells[0][0] = "Группа";
	sgGroups->Cells[1][0] = "Кол-во";
	sgGroups->Cells[2][0] = "Расч.";
    AutoWidthSG(sgGroups);

	sgWorkers->Cells[0][0] = "Таб №";
	sgWorkers->Cells[1][0] = "Фамилия";
	sgWorkers->Cells[2][0] = "Имя";
	sgWorkers->Cells[3][0] = "Отчество";
	sgWorkers->Cells[4][0] = "Профессия";
	sgWorkers->Cells[5][0] = "Разряд";
	AutoWidthSG(sgWorkers);

    OnShow();
}
Ejemplo n.º 14
0
void CCWidget::Show(bool bVisible, bool bModal){
	if(m_bVisible==bVisible){
		if(bModal==true){
			if(m_pParent!=NULL && m_pParent->GetLatestExclusive()==this)
				return;
		}
		else return;
	}

	m_bVisible = bVisible;

	if(bVisible==true && bModal==true) SetExclusive();
	else if(bVisible==false) {
		ReleaseExclusive();
		if(CCWidget::m_pFocusedWidget==this) ReleaseFocus();
	}

	OnShow(bVisible);
}
Ejemplo n.º 15
0
void CXTPPopupControl::OnTimer(UINT_PTR nIDEvent)
{
	CWnd::OnTimer(nIDEvent);

	switch (nIDEvent)
	{
		//if expand ore collapsing state
		case TID_EXPANDING:
		case TID_COLLAPSING:
			//animate from current to target
			Animate(m_nStep);
			m_nStep--;

			//if end step
			if (m_nStep <= 0)
			{
				//kill timer event
				KillTimer(nIDEvent);

				//change popup state
				if (nIDEvent == TID_EXPANDING)
					OnShow();
				else
					Close();
			}

			break;

		//if popup wnd shown
		case TID_SHOWDELAY:
			//if mouse cursor is not capture
			if (!m_bCapture)
			{
				//kill timer event
				KillTimer(TID_SHOWDELAY);
				//set collapsing state
				OnCollapsing();
			}
			break;

	}
}
Ejemplo n.º 16
0
int main(int _NbrParams, char* _tabstrParams[]) {
	// Initialisation...
	Init(1024, 768);
	dlgNom = new CMSFVTextBox(pSDLRenderer);
	dlgTexte = new CMSFVMemo(pSDLRenderer);
	mnuContextuel = new CMenu();

	// Exécution...
	OnShow();
	while (Execution());
	OnClose();

	// Conclusion...
	delete mnuContextuel;
	delete dlgTexte;
	delete dlgNom;

	delete pArbreIndSelect;
	//	delete pRacine;
	//	delete pCurrent;

	return 0;
}
Ejemplo n.º 17
0
void COleServerItem::OnDoVerb(LONG iVerb)
{
	switch (iVerb)
	{
	// open - maps to OnOpen
	case OLEIVERB_OPEN:
	case -OLEIVERB_OPEN-1:  // allows positive OLEIVERB_OPEN-1 in registry
		OnOpen();
		break;

	// primary, show, and unknown map to OnShow
	case OLEIVERB_PRIMARY:  // OLEIVERB_PRIMARY is 0 and "Edit" in registry
	case OLEIVERB_SHOW:
		OnShow();
		break;

	// hide maps to OnHide
	case OLEIVERB_HIDE:
	case -OLEIVERB_HIDE-1:  // allows positive OLEIVERB_HIDE-1 in registry
		OnHide();
		break;

	default:
		// negative verbs not understood should return E_NOTIMPL
		if (iVerb < 0)
			AfxThrowOleException(E_NOTIMPL);

		// positive verb not processed --
		//  according to OLE spec, primary verb should be executed
		//  instead.
		OnDoVerb(OLEIVERB_PRIMARY);

		// also, OLEOBJ_S_INVALIDVERB should be returned.
		AfxThrowOleException(OLEOBJ_S_INVALIDVERB);
	}
}
Ejemplo n.º 18
0
MultiViewSelectionDialog::MultiViewSelectionDialog( bool allowPreviews ) :
   Dialog(),
   m_selectedViews(),
   m_allowPreviews( allowPreviews )
{
   SetSizer( Global_Sizer );

   Global_Sizer.SetMargin( 8 );
   Global_Sizer.SetSpacing( 6 );
   Global_Sizer.Add( Views_TreeBox );
   Global_Sizer.Add( Row2_Sizer );

   Row2_Sizer.SetSpacing( 8 );
   Row2_Sizer.Add( SelectAll_PushButton );
   Row2_Sizer.Add( UnselectAll_PushButton );
   Row2_Sizer.AddStretch();

   if ( m_allowPreviews )
   {
      Row2_Sizer.Add( IncludePreviews_CheckBox );
      Row2_Sizer.Add( IncludeMainViews_CheckBox );
   }

   Global_Sizer.AddSpacing( 6 );
   Global_Sizer.Add( Buttons_Sizer );

   Buttons_Sizer.SetSpacing( 8 );
   Buttons_Sizer.AddStretch();
   Buttons_Sizer.Add( OK_PushButton );
   Buttons_Sizer.Add( Cancel_PushButton );

   Views_TreeBox.SetNumberOfColumns( 1 );
   Views_TreeBox.HideHeader();
   Views_TreeBox.DisableRootDecoration();
   Views_TreeBox.EnableAlternateRowColor();
   Views_TreeBox.SetScaledMinHeight( 300 );

   SelectAll_PushButton.SetText( "Select All" );
   SelectAll_PushButton.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::ButtonClick, *this );

   UnselectAll_PushButton.SetText( "Unselect All" );
   UnselectAll_PushButton.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::ButtonClick, *this );

   if ( m_allowPreviews )
   {
      IncludeMainViews_CheckBox.SetText( "Main views" );
      IncludeMainViews_CheckBox.SetToolTip( "<p>Include main views in the list of selectable views.</p>" );
      IncludeMainViews_CheckBox.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::OptionClick, *this );
      IncludeMainViews_CheckBox.SetChecked();

      IncludePreviews_CheckBox.SetText( "Previews" );
      IncludePreviews_CheckBox.SetToolTip( "<p>Include previews in the list of selectable views.</p>" );
      IncludePreviews_CheckBox.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::OptionClick, *this );
      IncludePreviews_CheckBox.SetChecked();
   }
   else
   {
      IncludeMainViews_CheckBox.Hide();
      IncludePreviews_CheckBox.Hide();
   }

   OK_PushButton.SetText( "OK" );
   OK_PushButton.SetDefault();
   OK_PushButton.SetCursor( StdCursor::Checkmark );
   OK_PushButton.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::ButtonClick, *this );

   Cancel_PushButton.SetText( "Cancel" );
   Cancel_PushButton.SetCursor( StdCursor::Crossmark );
   Cancel_PushButton.OnClick( (Button::click_event_handler)&MultiViewSelectionDialog::ButtonClick, *this );

   SetWindowTitle( "Select Views" );

   OnShow( (Control::event_handler)&MultiViewSelectionDialog::ControlShow, *this );

   Regenerate();
}
Ejemplo n.º 19
0
void qtDLGTrace::resizeEvent(QResizeEvent *event)
{
	m_maxRows = (tblTraceLog->verticalHeader()->height() / 12) - 1;
	
	OnShow(scrollTrace->value());
}
Ejemplo n.º 20
0
TIFFRangeOptionsDialog::TIFFRangeOptionsDialog( const TIFFFormat::OutOfRangePolicyOptions& options,
                                                int bitsPerSample,
                                                double minSampleValue, double maxSampleValue ) :
   Dialog(),
   outOfRange( options )
{
   if ( maxSampleValue < minSampleValue )
      Swap( minSampleValue, maxSampleValue );

   TIFFFormat::OutOfRangePolicyOptions o = TIFFFormat::DefaultOutOfRangePolicyOptions();

   int labelWidth = Font().Width( String( "If out of range:" ) + 'M' );

   //

   Info_Label.EnableWordWrapping();
   Info_Label.EnableRichText();
   Info_Label.SetText( "<p>This TIFF file stores a " + String( bitsPerSample ) + "-bit floating point image.<br>"
      "Its extreme pixel sample values are:</p>"
      "<p style=\"white-space:pre;\"><pre>" + String().Format( "Minimum: %+.15g", minSampleValue ) + "<br>"
                                            + String().Format( "Maximum: %+.15g", maxSampleValue ) + "</pre></p>"
      "<p>Please specify a range of values to correctly interpret existing pixel values in this image. "
      "The lower and upper range bounds below correspond to the limits of the available dynamic range in the "
      "context of this TIFF image. PixInsight will use these limits to scale pixel values to the normalized "
      "[0,1] range, where zero represents black and one represents white.</p>" );

   //

   LowerRange_NumericEdit.label.SetText( "Lower Range:" );
   LowerRange_NumericEdit.label.SetFixedWidth( labelWidth );
   LowerRange_NumericEdit.SetReal( true );
   LowerRange_NumericEdit.SetRange( -DBL_MAX, +DBL_MAX );
   LowerRange_NumericEdit.SetPrecision( 15 );
   LowerRange_NumericEdit.EnableScientificNotation();
   LowerRange_NumericEdit.SetScientificNotationTriggerExponent( 5 );
   LowerRange_NumericEdit.sizer.AddStretch();
   LowerRange_NumericEdit.SetToolTip( "<p>Lower range of input floating point pixel samples.</p>" );
   LowerRange_NumericEdit.SetValue( o.lowerRange );

   UpperRange_NumericEdit.label.SetText( "Upper Range:" );
   UpperRange_NumericEdit.label.SetFixedWidth( labelWidth );
   UpperRange_NumericEdit.SetReal( true );
   UpperRange_NumericEdit.SetRange( -DBL_MAX, +DBL_MAX );
   UpperRange_NumericEdit.SetPrecision( 15 );
   UpperRange_NumericEdit.EnableScientificNotation();
   UpperRange_NumericEdit.SetScientificNotationTriggerExponent( 5 );
   UpperRange_NumericEdit.sizer.AddStretch();
   UpperRange_NumericEdit.SetToolTip( "<p>Upper range of input floating point pixel samples.</p>" );
   UpperRange_NumericEdit.SetValue( o.upperRange );

   ReadRescaleMode_Label.SetText( "If out-of-range:" );
   ReadRescaleMode_Label.SetTextAlignment( TextAlign::Right|TextAlign::VertCenter );
   ReadRescaleMode_Label.SetMinWidth( labelWidth );

   ReadRescaleMode_ComboBox.AddItem( "Rescale image to the specified range" );
   ReadRescaleMode_ComboBox.AddItem( "Truncate all out-of-range values" );
   ReadRescaleMode_ComboBox.SetToolTip( "<p>This parameter tells how to fix input pixel samples whose values "
                                        "exceed the specified input range.</p>" );
   ReadRescaleMode_ComboBox.SetCurrentItem( outOfRange.outOfRangeFixMode );

   ReadRescaleMode_Sizer.SetSpacing( 4 );
   ReadRescaleMode_Sizer.Add( ReadRescaleMode_Label );
   ReadRescaleMode_Sizer.Add( ReadRescaleMode_ComboBox, 100 );

   ReadRange_Sizer.SetMargin( 6 );
   ReadRange_Sizer.SetSpacing( 4 );
   ReadRange_Sizer.Add( LowerRange_NumericEdit );
   ReadRange_Sizer.Add( UpperRange_NumericEdit );
   ReadRange_Sizer.Add( ReadRescaleMode_Sizer );

   ReadRange_GroupBox.SetTitle( "Floating Point Input Range" );
   ReadRange_GroupBox.SetSizer( ReadRange_Sizer );

   //

   OK_PushButton.SetText( "OK" );
   OK_PushButton.SetDefault();
   OK_PushButton.SetCursor( StdCursor::Checkmark );
   OK_PushButton.OnClick( (pcl::Button::click_event_handler)&TIFFRangeOptionsDialog::Button_Click, *this );

   Cancel_PushButton.SetText( "Cancel" );
   Cancel_PushButton.SetCursor( StdCursor::Crossmark );
   Cancel_PushButton.OnClick( (pcl::Button::click_event_handler)&TIFFRangeOptionsDialog::Button_Click, *this );

   BottomSection_Sizer.SetSpacing( 8 );
   BottomSection_Sizer.AddStretch();
   BottomSection_Sizer.Add( OK_PushButton );
   BottomSection_Sizer.Add( Cancel_PushButton );

   //

   Global_Sizer.SetMargin( 8 );
   Global_Sizer.Add( Info_Label );
   Global_Sizer.AddSpacing( 12 );
   Global_Sizer.Add( ReadRange_GroupBox );
   Global_Sizer.AddSpacing( 12 );
   Global_Sizer.Add( BottomSection_Sizer );

   SetSizer( Global_Sizer );
   SetWindowTitle( "TIFF Floating Point Range Options" );

   OnShow( (Control::event_handler)&TIFFRangeOptionsDialog::Control_Show, *this );
   OnReturn( (Dialog::return_event_handler)&TIFFRangeOptionsDialog::Dialog_Return, *this );
}
Ejemplo n.º 21
0
void CXTPPopupControl::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bSplashScreenMode)
	{
		CXTPClientRect rc(this);

		//test client rect if no-pressed
		BOOL bInRect = rc.PtInRect(point) || m_pPressed != NULL;

		//if test successfull and already not capture
		if (bInRect && !m_bCapture)
		{
			//set capture
			m_bCapture = TRUE;

			//opaque window
			SetLayeredWindowAttributes(255);

			//capture mouse leave event
			TRACKMOUSEEVENT tme =
			{
				sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, 0
			};
			_TrackMouseEvent(&tme);
		}
		//else if test fail and there is pressed and selected control
		if (!bInRect && m_bCapture && m_pPressed == NULL)
		{
			//free capture
			m_bCapture = FALSE;
			//set current transparent
			SetLayeredWindowAttributes(m_nTransparency);
		}

		//if collapsing state - expand popup window
		if (m_popupState == xtpPopupStateCollapsing)
		{
			//kill collapsing timer
			KillTimer(TID_COLLAPSING);

			if (m_popupAnimation == xtpPopupAnimationFade)
			{
				OnShow();
			}
			else
			{
				OnExpanding(FALSE);
			}
		}
	}

	//test point to controled items
	CXTPPopupItem* pSelected = HitTest(point);

	//if detect new selected item ore lose selection (NULL)
	if (pSelected != m_pSelected)
	{
		//select new item ore set NULL
		m_pSelected = (m_pPressed == 0 || m_pPressed == pSelected || pSelected == NULL) ? pSelected : NULL;

		//redraw all items
		RedrawControl();
	}

	CWnd::OnMouseMove(nFlags, point);
}
Ejemplo n.º 22
0
int XWindow::RunModal()
{
    Prepare();

    // Trap XWindows "WM_DELETE_WINDOW" message
    Atom wmDeleteMessage = XInternAtom(windowDisplay, "WM_DELETE_WINDOW", false);
    XSetWMProtocols(windowDisplay, window, &wmDeleteMessage, 1);

    XkbEvent event;
    do {
        // Gets the new event
        int res = XNextEvent(windowDisplay, &event.core);
        if (window != event.core.xany.window) continue;

        // Processes the events
        if (event.type == ButtonPress) {
            WindowEventMouseButton e(&event.core.xbutton);
            OnMouseDown(&e);
        } else if (event.type == ButtonRelease) {
            WindowEventMouseButton e(&event.core.xbutton);
            OnMouseUp(&e);
        } else if (event.type == MotionNotify) {
            WindowEventMouseMove e(&event.core.xmotion);
            OnMouseMove(&e);
        } else if (event.type == EnterNotify) {
            WindowEventEnterLeave e(&event.core.xcrossing);
            OnMouseEnterLeave(&e);
        } else if (event.type == LeaveNotify) {
            WindowEventEnterLeave e(&event.core.xcrossing);
            OnMouseEnterLeave(&e);
        } else if (event.type == FocusIn) {
            WindowEventFocus e(&event.core.xfocus);
            OnFocus(&e);
        } else if (event.type == FocusOut) {
            WindowEventFocus e(&event.core.xfocus);
            OnFocus(&e);
        } else if (event.type == Expose && event.core.xexpose.count == 0) {
            WindowEventDraw e(gc, &event.core.xexpose);
            OnDraw(&e);
        } else if (event.type == VisibilityNotify) {
            WindowEventVisible e(&event.core.xvisibility);
            OnVisible(&e);
        } else if (event.type == UnmapNotify) {
            WindowEventShow e(false);
            OnShow(&e);
        } else if (event.type == MapNotify) {
            WindowEventShow e(true);
            OnShow(&e);
        } else if (event.type == ConfigureNotify) {
            bool generateWindowMoveEvent =
                area->GetX() != event.core.xconfigure.x ||
                area->GetY() != event.core.xconfigure.y;
            bool generateWindowResizeEvent =
                area->GetWidth() != event.core.xconfigure.width ||
                area->GetHeight() != event.core.xconfigure.height;

            *area = NRectangle(
                        event.core.xconfigure.x, event.core.xconfigure.y,
                        event.core.xconfigure.width, event.core.xconfigure.height);
            borderwidth = event.core.xconfigure.border_width;

            if (generateWindowMoveEvent) {
                WindowEventMove e(&event.core.xconfigure);
                OnMove(&e);
            }
            if (generateWindowResizeEvent) {
                gc->Resize(area->GetWidth(), area->GetHeight());	// Resize XWindowGraphics
                WindowEventResize e(&event.core.xconfigure);
                OnResize(&e);
            }
        } else if (event.type == ColormapNotify) {
            WindowEventColormap e(&event.core.xcolormap);
            OnColormap(&e);
        } else if (event.type == KeyPress) {
            WindowEventKey e(&event.core.xkey);
            OnKeyPress(&e);
        } else if (event.type == KeyRelease) {
            WindowEventKey e(&event.core.xkey);
            OnKeyRelease(&e);
        } else if (event.type == XDisplay::Default().XkbBaseEvent() + XkbEventCode) {
            // XkbEvents
            if (event.any.xkb_type == XkbMapNotify) {
                WindowEventKeymap e(&event.map);
                OnKeymap(&e);
            } else if (event.any.xkb_type == XkbNewKeyboardNotify) {
                WindowEventKeyboardMapping e(&event.new_kbd);
                OnKeyboardMapping(&e);
            } else if (event.any.xkb_type == XkbStateNotifyMask) {
                int kk = 1;
            }
        } else if (event.type == ClientMessage) {
            if (event.core.xclient.data.l[0] == wmDeleteMessage)
                break;
        } else if (event.type != 28 && event.type != 21) {
            int kk = 1;
        }

        // Locks the collection of delegations
        windowMutex->Lock();
        for (int i=0; i<delegationsToExecute->Count(); i++) {
            // Retrieve delegation and parameters
            void **item = (void **)(*delegationsToExecute)[i];
            NDelegation *d = (NDelegation *)item[0];
            void *params = item[1];

            // Execute delegation
            try {
                d->Execute(params);
            } catch (Exception *e) {
                delete e;
            }

            // Deletes delegation and item array
            delete d;
            delete item;
        }

        // Clear delegations collection and unlocks the mutex
        delegationsToExecute->Clear();
        windowMutex->Unlock();
    } while (true);

    Dispose();
}
Ejemplo n.º 23
0
 void InitializeHalDialogBase()
 {
     TBase* pT = static_cast<TBase*>(this);
     OnShow(pT->IsWindowVisible(), 0);
 }
Ejemplo n.º 24
0
void CNetscapeSrvrItem::OnDoVerb(LONG iVerb)
{
	switch (iVerb)
	{
	// open - maps to OnOpen
	case OLEIVERB_OPEN:
	case -OLEIVERB_OPEN-1:  // allows positive OLEIVERB_OPEN-1 in registry
		OnOpen();
		break;

	// primary, show, and unknown map to OnShow
	case OLEIVERB_PRIMARY:  // OLEIVERB_PRIMARY is 0 and "Edit" in registry
	case OLEIVERB_SHOW:
	case OLEIVERB_UIACTIVATE: {
		COleServerDoc* pDoc = GetDocument();
		m_ShowUI = TRUE;
		OnShow();
		break;
	}					  

	case OLEIVERB_INPLACEACTIVATE: {
		COleServerDoc* pDoc = GetDocument();
		m_ShowUI = FALSE;
		OnShow();
		break;
   }

	// hide maps to OnHide
	case OLEIVERB_HIDE:
	case -OLEIVERB_HIDE-1:  // allows positive OLEIVERB_HIDE-1 in registry
		OnHide();
		break;


	case NO_UI_EMBEDDING:	{
		//Get InPlaceFrame ptr.
		CGenericDoc *pDoc = GetDocument();
		ASSERT(pDoc);

		POSITION pos = pDoc->GetFirstViewPosition();
		CView *pView = pDoc->GetNextView(pos);
		ASSERT(pView);

		m_ShowUI = FALSE;

		OnShow();

		CInPlaceFrame *pFrm = (CInPlaceFrame *)pView->GetParent();
		ASSERT(pFrm);

		pFrm->DestroyResizeBar();

		break;
		}
	default:
		// negative verbs not understood should return E_NOTIMPL
		if (iVerb < 0)
			AfxThrowOleException(E_NOTIMPL);

		// positive verb not processed --
		//  according to OLE spec, primary verb should be executed
		//  instead.
		OnDoVerb(OLEIVERB_PRIMARY);

		// also, OLEOBJ_S_INVALIDVERB should be returned.
		AfxThrowOleException(OLEOBJ_S_INVALIDVERB);
	}
}