From: "Stefan Csomor" on
Hi

Thanks, would it be possible for your code to stay in a OnPaint handler
and use a wxPaintDC ?

Best,

Stefan

> -----Original Message-----
> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
> Sent: Donnerstag, 25. Januar 2007 13:27
> To: wx-users(a)lists.wxwidgets.org
> Subject: Re: wxScrolledWindow problems in wxMac 2.8.0
>
> Hi Stefan,
>
> Just to let you know that the same problem is present in CVS HEAD.
>
> Best Regards,
> Tilen
>
> On Jan 25, 2007, at 9:57 AM, Stefan Csomor wrote:
>
> > Hi Tilen
> >
> > Yes, WX_2_8_BRANCH has been created after the 2.8.1 drop
> >
> > Best,
> >
> > Stefan
> >
> >> -----Original Message-----
> >> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
> >> Sent: Donnerstag, 25. Januar 2007 10:20
> >> To: wx-users(a)lists.wxwidgets.org
> >> Subject: Re: wxScrolledWindow problems in wxMac 2.8.0
> >>
> >> Hi,
> >>
> >> Thanks for looking into this.
> >>
> >> I have tried this with 2.8.0 download and 2.8.1 download dated
> >> January 9th, but not with CVS HEAD. I would like to stick to the
> >> stable release if at all possible.
> >>
> >> Best Regards,
> >> Tilen
> >>
> >>
> >> On Jan 25, 2007, at 9:15 AM, Stefan Csomor wrote:
> >>
> >>> Hi
> >>>
> >>> It would be best not to use wxClientDC but wxPaintDC anyway, but
> >> I'll
> >>> check whether I can fix things with a wxClientDC as well, I had
> to
> >>> resort to a deferred creation that only happens at the moment you
> >>> first
> >>> draw on a wxClientDC, because it is a expensive operation such an
> >>> out-of-order draw, so I guess the transformation matrix wasn't up
> >> to
> >>> date. Is this a 2.8.0 download or does it also happen with CVS
> >> HEAD ?
> >>>
> >>> Thanks,
> >>>
> >>> Stefan
> >>>
> >>>> -----Original Message-----
> >>>> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
> >>>> Sent: Mittwoch, 24. Januar 2007 23:47
> >>>> To: wx-users(a)lists.wxwidgets.org
> >>>> Subject: wxScrolledWindow problems in wxMac 2.8.0
> >>>>
> >>>> Hi,
> >>>>
> >>>> wxScrolledWindow::DoPrepareDC() does not properly "prepare" the
> y-
> >>>> coordinate of the scrolled position in wxMac 2.8.0. The x-
> >> coordinate
> >>>> is set properly. Also, wxMac 2.6.3 works as expected.
> >>>>
> >>>> Given that the scrollbars are moved from the default position,
> the
> >>>> following will draw a circle at the correct (scrolled) x-
> >> coordinate
> >>>> and not correct (device coordinate) y-coordinate position on
> wxMac
> >>>> (it behaves as expected under wxMSW):
> >>>>
> >>>> wxClientDC dc(wxGetApp().scrolledWindow);
> >>>> wxGetApp().scrolledWindow->DoPrepareDC(dc);
> >>>> dc.DrawCircle(100, 100, 50);
> >>>>
> >>>> However the following will work correctly on both platforms:
> >>>>
> >>>> wxClientDC dc(wxGetApp().scrolledWindow);
> >>>> scrolledWindow->CalcScrolledPosition(100, 100, &x, &y);
> >>>> dc.DrawCircle(x, y, 50);
> >>>>
> >>>> Can I safely use CalcScrolledPosition() and not bother with
> >>>> DoPrepareDC() at all on all platforms, or are there more things
> to
> >>>> take care of in scrolled position?
> >>>>
> >>>> Best Regards,
> >>>> Tilen
> >>>>
> >>>>
> >>>> ----------------------------------------------------------------
> --
> >> ---
> >>>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> >>>> For additional commands, e-mail: wx-users-
> help(a)lists.wxwidgets.org
> >>>
> >>>
> >>>
> >>> -----------------------------------------------------------------
> --
> >> --
> >>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> >>> For additional commands, e-mail: wx-users-
> help(a)lists.wxwidgets.org
> >>>
> >>>
> >>
> >>
> >> ------------------------------------------------------------------
> ---
> >> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> >> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
> >
> > -------------------------------------------------------------------
> --
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Tilen Jez on
Hello again,

I don't think so. I need to draw on the window during mouse events.

Best Regards,
Tilen

On Jan 25, 2007, at 1:32 PM, Stefan Csomor wrote:

> Hi
>
> Thanks, would it be possible for your code to stay in a OnPaint
> handler
> and use a wxPaintDC ?
>
> Best,
>
> Stefan
>
>> -----Original Message-----
>> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
>> Sent: Donnerstag, 25. Januar 2007 13:27
>> To: wx-users(a)lists.wxwidgets.org
>> Subject: Re: wxScrolledWindow problems in wxMac 2.8.0
>>
>> Hi Stefan,
>>
>> Just to let you know that the same problem is present in CVS HEAD.
>>
>> Best Regards,
>> Tilen
>>
>> On Jan 25, 2007, at 9:57 AM, Stefan Csomor wrote:
>>
>>> Hi Tilen
>>>
>>> Yes, WX_2_8_BRANCH has been created after the 2.8.1 drop
>>>
>>> Best,
>>>
>>> Stefan
>>>
>>>> -----Original Message-----
>>>> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
>>>> Sent: Donnerstag, 25. Januar 2007 10:20
>>>> To: wx-users(a)lists.wxwidgets.org
>>>> Subject: Re: wxScrolledWindow problems in wxMac 2.8.0
>>>>
>>>> Hi,
>>>>
>>>> Thanks for looking into this.
>>>>
>>>> I have tried this with 2.8.0 download and 2.8.1 download dated
>>>> January 9th, but not with CVS HEAD. I would like to stick to the
>>>> stable release if at all possible.
>>>>
>>>> Best Regards,
>>>> Tilen
>>>>
>>>>
>>>> On Jan 25, 2007, at 9:15 AM, Stefan Csomor wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> It would be best not to use wxClientDC but wxPaintDC anyway, but
>>>> I'll
>>>>> check whether I can fix things with a wxClientDC as well, I had
>> to
>>>>> resort to a deferred creation that only happens at the moment you
>>>>> first
>>>>> draw on a wxClientDC, because it is a expensive operation such an
>>>>> out-of-order draw, so I guess the transformation matrix wasn't up
>>>> to
>>>>> date. Is this a 2.8.0 download or does it also happen with CVS
>>>> HEAD ?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Stefan
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
>>>>>> Sent: Mittwoch, 24. Januar 2007 23:47
>>>>>> To: wx-users(a)lists.wxwidgets.org
>>>>>> Subject: wxScrolledWindow problems in wxMac 2.8.0
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> wxScrolledWindow::DoPrepareDC() does not properly "prepare" the
>> y-
>>>>>> coordinate of the scrolled position in wxMac 2.8.0. The x-
>>>> coordinate
>>>>>> is set properly. Also, wxMac 2.6.3 works as expected.
>>>>>>
>>>>>> Given that the scrollbars are moved from the default position,
>> the
>>>>>> following will draw a circle at the correct (scrolled) x-
>>>> coordinate
>>>>>> and not correct (device coordinate) y-coordinate position on
>> wxMac
>>>>>> (it behaves as expected under wxMSW):
>>>>>>
>>>>>> wxClientDC dc(wxGetApp().scrolledWindow);
>>>>>> wxGetApp().scrolledWindow->DoPrepareDC(dc);
>>>>>> dc.DrawCircle(100, 100, 50);
>>>>>>
>>>>>> However the following will work correctly on both platforms:
>>>>>>
>>>>>> wxClientDC dc(wxGetApp().scrolledWindow);
>>>>>> scrolledWindow->CalcScrolledPosition(100, 100, &x, &y);
>>>>>> dc.DrawCircle(x, y, 50);
>>>>>>
>>>>>> Can I safely use CalcScrolledPosition() and not bother with
>>>>>> DoPrepareDC() at all on all platforms, or are there more things
>> to
>>>>>> take care of in scrolled position?
>>>>>>
>>>>>> Best Regards,
>>>>>> Tilen
>>>>>>
>>>>>>
>>>>>> ----------------------------------------------------------------
>> --
>>>> ---
>>>>>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>>>>>> For additional commands, e-mail: wx-users-
>> help(a)lists.wxwidgets.org
>>>>>
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------
>> --
>>>> --
>>>>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>>>>> For additional commands, e-mail: wx-users-
>> help(a)lists.wxwidgets.org
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------
>> ---
>>>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>>>> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>>>
>>>
>>>
>>> -------------------------------------------------------------------
>> --
>>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>>> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Julian Smart on
Tilen Jez wrote:
> Hello again,
>
> I don't think so. I need to draw on the window during mouse events.
Although you may need to refactor the code slightly, you should still be
able to do this with wxPaintDC
by calling wxWindow::RefreshRect followed by Update, and optimizing your
code so it only draws
the necessary graphics within the current update region. See
wxPaintEvent for an example of
iterating through update rectangles.

Or, compile wxMac with wxMAC_USE_CORE_GRAPHICS set to 0 in
include/wx/mac/carbon/chkconf.h...

Regards,

Julian


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Tilen Jez on
Hi,

Thank you for the info.

I see how this could be done using wxPaintDC, but is this really the
correct approach? Say if one wants to draw a line between two points,
which is a trivial task using wxClientDC, using wxPaintDC the region
needs to be invalidated and everything on it repainted during
wxPaintEvent.

Best Regards,
Tilen


On Jan 25, 2007, at 3:30 PM, Julian Smart wrote:

> Tilen Jez wrote:
>> Hello again,
>>
>> I don't think so. I need to draw on the window during mouse events.
> Although you may need to refactor the code slightly, you should
> still be able to do this with wxPaintDC
> by calling wxWindow::RefreshRect followed by Update, and optimizing
> your code so it only draws
> the necessary graphics within the current update region. See
> wxPaintEvent for an example of
> iterating through update rectangles.
>
> Or, compile wxMac with wxMAC_USE_CORE_GRAPHICS set to 0 in include/
> wx/mac/carbon/chkconf.h...
>
> Regards,
>
> Julian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "Stefan Csomor" on
Hi Tilen

the problem with the new graphics engines are that "flushes" to the
display become expensive, on the latest OSX you shouldn't update more
frequently than at half the refresh rate, otherwise your program will
become blocked, while waiting for the next refresh cycle. So while you
think that it is just doing a LineTo, behind your back there is a lot
more blitting and synchronizing going on. Depending on the app you are
working on, the best solution might be to have a backing bitmap, on
which you draw using a memory dc at the moments you want to, and only
blit from that at OnPaint time.

Best Regards,

Stefan

> -----Original Message-----
> From: Tilen Jez [mailto:tilen.jez(a)ambitiongroup.com]
> Sent: Donnerstag, 25. Januar 2007 17:25
> To: wx-users(a)lists.wxwidgets.org
> Subject: Re: wxScrolledWindow problems in wxMac 2.8.0
>
> Hi,
>
> Thank you for the info.
>
> I see how this could be done using wxPaintDC, but is this really the
> correct approach? Say if one wants to draw a line between two points,
> which is a trivial task using wxClientDC, using wxPaintDC the region
> needs to be invalidated and everything on it repainted during
> wxPaintEvent.
>
> Best Regards,
> Tilen
>
>
> On Jan 25, 2007, at 3:30 PM, Julian Smart wrote:
>
> > Tilen Jez wrote:
> >> Hello again,
> >>
> >> I don't think so. I need to draw on the window during mouse
> events.
> > Although you may need to refactor the code slightly, you should
> > still be able to do this with wxPaintDC
> > by calling wxWindow::RefreshRect followed by Update, and optimizing
> > your code so it only draws
> > the necessary graphics within the current update region. See
> > wxPaintEvent for an example of
> > iterating through update rectangles.
> >
> > Or, compile wxMac with wxMAC_USE_CORE_GRAPHICS set to 0 in include/
> > wx/mac/carbon/chkconf.h...
> >
> > Regards,
> >
> > Julian
> >
> >
> > -------------------------------------------------------------------
> --
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org