void wxNewBitmapButton::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPaintDC dc(this); // first, make sure images for current state are prepared //RenderLabelImages(); DrawLabel( dc ); DrawDecorations( dc ); }
//--------------------------------------------------------------------------- void wxPagedWindow::OnMouseMove( wxMouseEvent& event ) { int width, height; GetClientSize( &width, &height ); if ( !mIsDragged ) { int y = height - mVertGap - BORDER_SZ - mTitleHeight; int x = mTitleRowStart + mTitleRowLen - 6; if ( event.m_x >= x && event.m_y >= y && event.m_x < x + 6 && event.m_y < y + mTitleHeight ) { if ( !mCursorChanged ) { SetCursor( mResizeCursor ); mCursorChanged = true; } } else if ( mCursorChanged ) { SetCursor( mNormalCursor ); mCursorChanged = false; } } else { if ( mIsDragged ) { mAdjustableTitleRowLen = mOriginalTitleRowLen + ( event.m_x - mDagOrigin ); // FOR NOW:: fixed if ( mAdjustableTitleRowLen < 6 ) mAdjustableTitleRowLen = 6; wxWindowDC dc(this); DrawDecorations( dc ); RecalcLayout(false); //Refresh(); } } } // wxPagedWindow::OnMouseMove()
//--------------------------------------------------------------------------- void wxPagedWindow::OnScroll( wxScrollEvent& event ) { wxScrollBar* pSender = (wxScrollBar*)event.GetEventObject(); // wxMessageBox("wxPagedWindow::OnScroll","-I->"); if ( pSender == mpTabScroll ) { int maxUnits = GetWholeTabRowLen() / 20; mCurentRowOfs = -event.GetPosition()*maxUnits; mFirstTitleGap = mTitleRowStart + mCurentRowOfs + mTabTrianGap; // let' it automatically disable itself if it's time mpTabScroll->Enable( mTitleRowLen < GetWholeTabRowLen() || mCurentRowOfs < 0 ); // repaint title bars wxWindowDC dc(this); DrawDecorations( dc ); } else { if ( !mScrollEventInProgress ) { mScrollEventInProgress = true; GetActiveTab()->GetEventHandler()->ProcessEvent( event ); } else { // event bounced back to us, from here we // know that it has traveled the loop - thus it's processed! mScrollEventInProgress = false; } } } // wxPagedWindow::OnScroll()
//--------------------------------------------------------------------------- // wx event handlers //--------------------------------------------------------------------------- void wxTabbedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPaintDC dc(this); DrawDecorations( dc ); }
/******************************************************************** * * Sets the input focus to the indicated window. * **********************************************************************/ static void DoSetFocus(Window w, FvwmWindow *Fw, Bool FocusByMouse, Bool NoWarp) { extern Time lastTimestamp; FvwmWindow *sf; if (Fw && WM_TAKES_FOCUS(Fw)) { send_clientmessage(dpy, w, _XA_WM_TAKE_FOCUS, lastTimestamp); } if (Fw && HAS_NEVER_FOCUS(Fw)) { if (WM_TAKES_FOCUS(Fw)) { /* give it a chance to take the focus itself */ XSync(dpy, 0); } else { /* make sure the window is not hilighted */ DrawDecorations(Fw, DRAW_ALL, False, False, None); } return; } if (Fw && !IS_LENIENT(Fw) && Fw->wmhints && (Fw->wmhints->flags & InputHint) && !Fw->wmhints->input && (sf = get_focus_window()) && sf->Desk == Scr.CurrentDesk) { return; } /* ClickToFocus focus queue manipulation - only performed for * Focus-by-mouse type focus events */ /* Watch out: Fw may not be on the windowlist and the windowlist may be * empty */ if (Fw && Fw != get_focus_window() && Fw != &Scr.FvwmRoot && !IS_SCHEDULED_FOR_DESTROY(Fw)) { if (FocusByMouse) /* pluck window from list and deposit at top */ { /* remove Fw from list */ if (Fw->prev) Fw->prev->next = Fw->next; if (Fw->next) Fw->next->prev = Fw->prev; /* insert Fw at start */ Fw->next = Scr.FvwmRoot.next; if (Scr.FvwmRoot.next) Scr.FvwmRoot.next->prev = Fw; Scr.FvwmRoot.next = Fw; Fw->prev = &Scr.FvwmRoot; } else { /* move the windowlist around so that Fw is at the top */ FvwmWindow *tmp_win; /* find the window on the windowlist */ tmp_win = &Scr.FvwmRoot; while (tmp_win && tmp_win != Fw) tmp_win = tmp_win->next; if (tmp_win) /* the window is on the (non-zero length) windowlist */ { /* make tmp_win point to the last window on the list */ while (tmp_win->next) tmp_win = tmp_win->next; /* close the ends of the windowlist */ tmp_win->next = Scr.FvwmRoot.next; Scr.FvwmRoot.next->prev = tmp_win; /* make Fw the new start of the list */ Scr.FvwmRoot.next = Fw; /* open the closed loop windowlist */ Fw->prev->next = NULL; Fw->prev = &Scr.FvwmRoot; } } } lastFocusType = FocusByMouse; if (!Fw && !Scr.flags.is_pointer_on_this_screen) { focus_grab_buttons(Scr.Ungrabbed, False); set_focus_window(NULL); /* DV (25-Nov-2000): Don't give the Scr.NoFocusWin the focus here. This * would steal the focus from the other screen's root window again. */ /* FOCUS_SET(Scr.NoFocusWin); */ return; } if (Fw && !NoWarp) { if (IS_ICONIFIED(Fw)) { rectangle r; r.x = Fw->icon_g.x; r.y = Fw->icon_g.y; r.width = Fw->icon_g.width; r.height = Fw->icon_p_height + Fw->icon_g.height; if (!IsRectangleOnThisPage(&r, Fw->Desk)) { Fw = NULL; w = Scr.NoFocusWin; } } else if (!IsRectangleOnThisPage(&(Fw->frame_g),Fw->Desk)) { Fw = NULL; w = Scr.NoFocusWin; } } /* RBW - 1999/12/08 - we have to re-grab the unfocused window here for the MouseFocusClickRaises case also, but we can't ungrab the newly focused window here, or we'll never catch the raise click. For this special case, the newly-focused window is ungrabbed in events.c (HandleButtonPress). */ if (Scr.Ungrabbed != Fw) { /* need to grab all buttons for window that we are about to unfocus */ focus_grab_buttons(Scr.Ungrabbed, False); } /* if we do click to focus, remove the grab on mouse events that * was made to detect the focus change */ if (Fw && HAS_CLICK_FOCUS(Fw)) { focus_grab_buttons(Fw, True); } /* RBW - allow focus to go to a NoIconTitle icon window so * auto-raise will work on it... */ if (Fw && IS_ICONIFIED(Fw)) { Bool is_window_selected = False; if (Fw->icon_w) { w = Fw->icon_w; is_window_selected = True; } if ((!is_window_selected || WAS_ICON_HINT_PROVIDED(Fw)) && Fw->icon_pixmap_w) { w = Fw->icon_pixmap_w; } } if (Fw && IS_LENIENT(Fw)) { FOCUS_SET(w); set_focus_window(Fw); SET_FOCUS_CHANGE_BROADCAST_PENDING(Fw, 1); Scr.UnknownWinFocused = None; } else if (!Fw || !(Fw->wmhints) || !(Fw->wmhints->flags & InputHint) || Fw->wmhints->input != False) { /* Window will accept input focus */ FOCUS_SET(w); set_focus_window(Fw); if (Fw) { SET_FOCUS_CHANGE_BROADCAST_PENDING(Fw, 1); } Scr.UnknownWinFocused = None; } else if ((sf = get_focus_window()) && sf->Desk == Scr.CurrentDesk) { /* Window doesn't want focus. Leave focus alone */ /* FOCUS_SET(Scr.Hilite->w);*/ } else { FOCUS_SET(Scr.NoFocusWin); set_focus_window(NULL); } XSync(dpy,0); return; }