Navigation:  Tutorials > Creating a GUI Application >

Drawing a View for PersonalAccountTransactionDialog

Previous pageReturn to chapter overviewNext page

Following basically the same procedure as before, use the View Composer to create a view for the PersonalAccountTransactionDialog presenter. This time, however, you are creating a dialog, so you should choose the Dialogs category in the view toolbox and drag a Dialog.Default view across to the arena.

Tip: Alternatively, you can use the File/New Dialog View command to create a blank dialog for painting on.

You'll want to end up with something like this:


Before you start, confirm the connection points to the presenter. In PersonalAccountTransactionDialog we have:

Sub-presenter type

Connection name

Model aspect

DatePresenter

'date'

#date

NumberPresenter

'amount'

#amount

TextPresenter

'description'

#description

BooleanPresenter

'isDebit'

#isDebit

 

You'll find that the DatePresenter class has several possible views that can be used to display dates. In the above we have chosen the Picker view so that the date will be displayed and edited in a dropdown calendar-style entry field. You might also like to try using a Month view which is the Windows control specifically designed for the graphical display of calendar pages. The interesting thing here, is that you can choose either view (or maybe go back later and choose a different one) without having to change any of your Smalltalk (presenter) code. This again demonstates the real flexibility of MVP.