|
List Info
Thread: Starting a Project
|
|
| Starting a Project |

|
2006-05-27 02:50:06 |
|
work that DialogBlocks does will soften my transition into wx. But of
course, there's some stuff that it will do that I wouldn't when hard-
coding.
Here's a start: when I make a new project, I have no window, When I
first tried to make one, it obviously was the wrong type, and many
essential functions weren't found. After pinning that down, and going
back to the book, I've started with a wxDocParentFrame. That at least
gets me going, but when I try to quit, I get an access fault at
wxListBase::GetFirst
It seems that wxDocManager is trying to close all the documents, and
it gets the first with m_docs.getFirst(). the answer is not NULL, but
a suspicious 0x34. And sure enough, it goes nowhere.
So I suspect that I haven't created the document, just the frame, and
that's the problem. First, it's a bit odd that DB let me create an
incorrectly initialized doc/frame. Second, perhaps DB could create a
first window as part of the new project wizard? And third, what's the
'correct' way to do this. In other frameworks, I'd expect to have an
init or appleevent function and create a new document there. How
would I do that from DB, or do I need to go straight to code?
Bruce Wheaton
|
| Starting a Project |

|
2006-05-27 03:42:21 |
|
wrote:
>
> I'm just starting off with wxWidgets and DialogBlocks. I'm hoping
the
> work that DialogBlocks does will soften my transition into wx. But
of
> course, there's some stuff that it will do that I wouldn't when
hard-
> coding.
>
> Here's a start: when I make a new project, I have no window, When
I
> first tried to make one, it obviously was the wrong type, and
many
> essential functions weren't found. After pinning that down, and
going
> back to the book, I've started with a wxDocParentFrame. That at
least
> gets me going, but when I try to quit, I get an access fault at
> wxListBase::GetFirst
>
> It seems that wxDocManager is trying to close all the documents,
and
> it gets the first with m_docs.getFirst(). the answer is not NULL,
but
> a suspicious 0x34. And sure enough, it goes nowhere.
>
> So I suspect that I haven't created the document, just the frame,
and
> that's the problem. First, it's a bit odd that DB let me create
an
> incorrectly initialized doc/frame. Second, perhaps DB could create
a
> first window as part of the new project wizard? And third, what's
the
> 'correct' way to do this. In other frameworks, I'd expect to have
an
> init or appleevent function and create a new document there. How
> would I do that from DB, or do I need to go straight to code?
>
> Bruce Wheaton
>
Okay, here it is, by the numbers:
1) Select Create new project
2) In the firt New Project Wizard window, browse to a location on
disk and enter a project name (no extension) and select Save.
3) If you want to identify the code at the top of each file, enter
your name and your copyright boilerplate.
4) Click Next.
5) If you want XRC files (I don't do this, so I'm not sure what
it entails), check the box in the next window and enter a file
name.
6) Click Next.
7) In the next window, you have an opportunity to have an
application generated or not. Default is to have one and it's
a good default unless you really know what you're doing and
want to do something exotic and handle the operating system
yourself. Anyway, let's say you just accept it. Change the
names to protect the innocent if you don't like the defaults.
8) Click Next.
9) Select the Create Standard Configurations button in the next
window (again, unless you want to handle all the
compiler/linker/etc. youself) Enter the compiler(s) you want
to use from the pulldown menu.
10) Click Next.
11) Source encoding and System encoding is relatively new. I
haven't used it. It appears to be related to XRC. If you
know what it is, use it.
12) Click Finish.
13) From the menu bar select Element an choose one of the first
four. Most likely, you'll want either Dialog or Frame. You
do need one of the four, however, for the application's top
window.
14) I selected Add Frame and in the popup I entered the Window
Title, the Class name, the cpp and the h file names. Again,
if you don't like the defaults that are generated, change them.
15) Click OK.
16) Now, this is the important part. In the Projects window,
click on the application name in the tree, the one with the
wheel by it (looks like a little driving wheel).
17) In the Editor window, to the right, you'll see a table dialog
with name/value pairs. Click the pulldown in the entry field
next to Main window and select the _only_ manifest constant
name there. That's the one assigned by DB (you can change it
later if you like but that's not important here, now).
18) In the tool bar, at the far right, is a pulldown that contains
the name(s) of the compilers you entered. Click on the one
you'd like to use.
19) In the menu bar, select Build and click on Build and Run.
You should get a simple window. If not, you don't have the
compiler info entered or entered correctly. Select Build in the
menu bar and click on Configurations. You can go through
everything for your own gratification as you wish, but the
important thing is the last selection, Paths. Enter the locations
for your compiler's binaries, libs, and includes as well as where
your wxWidgets is installed. If the information here is correct,
the compiler should work. If it doesn't, you'll have to go through
the Configurations (next to last selection) and check that the
information there matches your compiler.
This is basically how all projects/applications in DB are done.
The rest is dependent on what you're trying to build. But if the
basic starting point isn't correct (especially Main window), the
whole thing goes willy-nilly.
Basically, the app file is your 'hub' from which everything starts.
Take a good look at the structure of this file, it's key to
wxWidgets in general.
The top window file (Dialog, Panel, Frame, Wizard) has the widget
that is the parent of all other widgets
(or grandparent, greatgrandparent,...). It's a good idea to have
a good look at this file, too.
HTH,
Dave S.
|
[1-2]
|
|