wxScreenDC & wxDisplay

Steven Van Ingelgem steven at vaningelgem.be
Tue Nov 6 13:54:33 PST 2007


Thanks :-)

On 11/6/07, Chris Mellon <arkanes at gmail.com> wrote:
> On Nov 4, 2007 5:29 PM, Steven Van Ingelgem <steven at vaningelgem.be> wrote:
> > What I would use is wxScreenDC, but for that one, I can't tell to
> > choose the screen... I'm thinking now 1 big screen 1280x1024 in the
> > middle, and 2 smaller (800x600) at the sides. What would it return?
> > The entire area or only the primary monitor (my guess is the primary
> > monitor only).
> >
> > Maybe I didn't clearly stated what I wanted to do, but what I want to
> > achieve is to draw the image on each screen which is not the primary.
> > Not streched or so.
> >
> > For that I need something to draw upon. I know I would be able to get
> > the sizes with the GetGeometry, but not how they relate to the primary
> > display.
>
> This is remembered from when I was developing with 2 screens, but I
> don't have a dual head setup anymore so I'm sure someone will correct
> me if I'm wrong:
>
> The top left corner of the primary display is (0,0). The rects
> returned by GetGeometry will be   relative to that origin. For
> example, if you have 2 monitors, and the right one is the primary, the
> geometry for the left hand display will have a negative position.
>
> >
> > I will check tomorrow at work. That's more easy for quick testing.
> >
> >
> > I have a few ideas, maybe you can immediately tell me if they are
> > wrong so I don't waste time testing them:
> >
> > 1) GetGeometry-rect: does it completely define 1 display? (relative
> > coordinate system into screendc maybe?)
> > 2a) wxScreenDC is everything, all the displays together (question: how
> > does it handle different sized displays?) -> get the wxRect from
> > wxDisplay & draw on those coordinates.
> > 2b) Create a wxFrame, move it to the other monitor (get wxRect from
> > wxDisplay) & fullscreen it to cover the taskbar and stuff. -> does
> > fullscreen work on all the displays or only on the display the frame
> > is on?
> >
> pseudo (well, wxPython)-code:
>
> for displayIndex in range(wx.Display.GetCount()):
>     display = wx.Display(displayIndex)
>     if (not display.IsOk()) or display.IsPrimary():
>         continue
>     dframe = wx.Frame(None) #style flags as appropriate
>     dframe.SetPosition(display.GetGeometry().GetPosition())
>     dframe.ShowFullscreen(True)
>     #or, if ShowFullscreen doesn't work
>     dframe.SetRect(display.GetGeometry())
>     dframe.Show()
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>




More information about the wx-users mailing list