List Info

Thread: How best to create a temporary window for drawing text - MSW C++7.1




How best to create a temporary window for drawing text - MSW C++7.1
country flaguser name
United States
2007-04-05 18:48:52
I have developed a Dialog-based program GUI for a user to
enter some 
file names and parameters and press "Calculate" to
run a calculation. I 
want to have a window pop up and be filled with text giving
the progress 
of the calculation, such as
Case #1
Reading input
Calculating blah blah
Case #2.

(This is a GUI for an engineering program used for years on
the DOS 
command line with lots if printf statement)

I have not been able to figure out how to add this window
within DB. I 
can sort of make it work by manually adding some code in my
main 
Dialog's onCalculate function that creates a wxFrame and
passes a 
pointer into my calculation engine function where I used
wxClientDC to 
create a device context and then write text to the Frame
incrementing 
the y coordinate for each new line. When it reaches the
bottom of the 
Frame, I clear the Frame and start back at the top. I also
tried it with 
wxScrolledWindow and get a similar result.

I noticed in both cases it worked OK until I tried to move
the temporary 
window around. It goes blank and does not redraw after I
touch it, but 
the calculation carries on.

What would be nice is to have a window that fills with text
from the top 
down and then scrolls as more is added.

How do you add this in DialogBlocks? I started at the
Windows level 
("Add your windows under this folder") and added a
new Dialog named 
ProgressDialog and then put a wxScrolledWindow in the new
Dialog. If I 
do that, I am not sure how to access the wxScrolledWindow
for writing to 
it. Do I need to use an INIT_DIALOG event handler in the
ProgressDialog 
class to access the member variable for the wxScrolledWindow
so as to be 
able to create a DC for writing? If I try to access the
wxScrolledWindow 
from my main Dialog's onCalculate function, it becomes an
overlaid 
window on the main Dialog.

Ian



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    htt
p://groups.yahoo.com/group/anthemion-devtools/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/anthemion-devtools/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:anthemion-devtools-digest@yahoogroups.com 
    mailto:anthemion-devtools-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    anthemion-devtools-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: How best to create a temporary window for drawing text - MSW C++7.1
country flaguser name
United States
2007-04-05 19:08:50
>-- On Thu, 05 Apr 2007 16:48:52 -0700 Ian Simpson wrote
--
> I have developed a Dialog-based program GUI for a user
to enter
> some file names and parameters and press
"Calculate" to run a
> calculation. I want to have a window pop up and be
filled with text
> giving the progress of the calculation, such as Case #1
Reading
> input Calculating blah blah Case #2.
>
> (This is a GUI for an engineering program used for
years on the DOS
> command line with lots if printf statement)
>
> I have not been able to figure out how to add this
window within
> DB. I can sort of make it work by manually adding some
code in my
> main Dialog's onCalculate function that creates a
wxFrame and
> passes a pointer into my calculation engine function
where I used
> wxClientDC to create a device context and then write
text to the
> Frame incrementing the y coordinate for each new line.
When it
> reaches the bottom of the Frame, I clear the Frame and
start back
> at the top. I also tried it with wxScrolledWindow and
get a similar
> result.
>
> I noticed in both cases it worked OK until I tried to
move the
> temporary window around. It goes blank and does not
redraw after I
> touch it, but the calculation carries on.
>
> What would be nice is to have a window that fills with
text from
> the top down and then scrolls as more is added.
>
> How do you add this in DialogBlocks? I started at the
Windows level
> ("Add your windows under this folder") and
added a new Dialog named
> ProgressDialog and then put a wxScrolledWindow in the
new Dialog.
> If I do that, I am not sure how to access the
wxScrolledWindow for
> writing to it. Do I need to use an INIT_DIALOG event
handler in the
> ProgressDialog class to access the member variable for
the
> wxScrolledWindow so as to be able to create a DC for
writing? If I
> try to access the wxScrolledWindow from my main
Dialog's
> onCalculate function, it becomes an overlaid window on
the main
> Dialog.
>
> Ian
>
>

Hi!

I believe what you're looking for is a wxTextCtrl (used and
with many 
particulars in both Data Converter and Regex tutorials!;)
What you describe is 
what on many platforms is called a console window and/or
information window. 
Usually tucked away somewhere in a corner in the
application, spewing out "warm 
fuzzy" data for the user's gratification and/or
debugging information.

HTH:

BTW, you know that the Visual Studio 2005 Express is
"free forever"(!:-O ), 
quite a surprise from Microsoft!;) Its chief advantage
(besides a great IDE) is 
that it has an optimizing compiler, whereas, last I heard,
7.x was not. DB works 
great with the Visual Studio 2005, just specify VC++ Project
for the compiler 
configuration. Then, you can use the GUI debugger in Visual
Studio with the code 
you've generated in DB.

Links are specified at wxMS_developers to get Visual Studio
2005 Express. As 
they say, "Try it! You'll like it!"

Also, .pjd's are great for sharing to see what exactly one
is trying to do!;) 
Don't forget, any files containing any hand coding are
needed (as well as image 
files), these cannot be generated by DB!

 
thx,
Dave S.
 
Arthur Dent:
  COMPUTER DO SOMETHING!
Eddie the Computer:
  Sure thing fella! Switching to manual control... good
luck!
 
wxMS_developers · Development with wxWidgets on MSWindows 
h
ttp://tech.groups.yahoo.com/group/wxMS_developers/
 
wxWidgets Code Exchange
http://wxcodex.net/
 


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    htt
p://groups.yahoo.com/group/anthemion-devtools/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/anthemion-devtools/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:anthemion-devtools-digest@yahoogroups.com 
    mailto:anthemion-devtools-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    anthemion-devtools-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: How best to create a temporary window for drawing text - MSW C++7.1
country flaguser name
United Kingdom
2007-04-06 02:21:30
Hi,

If you want to draw on a window, you can use
wxScrolledWindow or 
wxWindow, derive
a new class, and add a paint event handler. Unless you
provide a paint 
handler, what you
draw will be erased when the window is refreshed. wxClientDC
should not 
be used unless
absolutely necessary (e.g. within a mouse event handler).

Regards,

Julian

Ian Simpson wrote:
> I have developed a Dialog-based program GUI for a user
to enter some 
> file names and parameters and press
"Calculate" to run a calculation. I 
> want to have a window pop up and be filled with text
giving the progress 
> of the calculation, such as
> Case #1
> Reading input
> Calculating blah blah
> Case #2.
>
> (This is a GUI for an engineering program used for
years on the DOS 
> command line with lots if printf statement)
>
> I have not been able to figure out how to add this
window within DB. I 
> can sort of make it work by manually adding some code
in my main 
> Dialog's onCalculate function that creates a wxFrame
and passes a 
> pointer into my calculation engine function where I
used wxClientDC to 
> create a device context and then write text to the
Frame incrementing 
> the y coordinate for each new line. When it reaches the
bottom of the 
> Frame, I clear the Frame and start back at the top. I
also tried it with 
> wxScrolledWindow and get a similar result.
>
> I noticed in both cases it worked OK until I tried to
move the temporary 
> window around. It goes blank and does not redraw after
I touch it, but 
> the calculation carries on.
>
> What would be nice is to have a window that fills with
text from the top 
> down and then scrolls as more is added.
>
> How do you add this in DialogBlocks? I started at the
Windows level 
> ("Add your windows under this folder") and
added a new Dialog named 
> ProgressDialog and then put a wxScrolledWindow in the
new Dialog. If I 
> do that, I am not sure how to access the
wxScrolledWindow for writing to 
> it. Do I need to use an INIT_DIALOG event handler in
the ProgressDialog 
> class to access the member variable for the
wxScrolledWindow so as to be 
> able to create a DC for writing? If I try to access the
wxScrolledWindow 
> from my main Dialog's onCalculate function, it becomes
an overlaid 
> window on the main Dialog.
>
> Ian
>
>
>
>  
> Yahoo! Groups Links
>
>
>
>
>
>   


-- 
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD:     www.anthemion.co.uk/dialogblocks



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    htt
p://groups.yahoo.com/group/anthemion-devtools/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/anthemion-devtools/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:anthemion-devtools-digest@yahoogroups.com 
    mailto:anthemion-devtools-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    anthemion-devtools-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )