The query window parts look similar to this:

Constructing OAQueryContract
- Create a visual part as follows:
- For the base class, use IFrameWindow
- For the client type, use IMultiCellCanvas
- Name it OAQueryContract
The part opens in the Composition Editor.
- In the IFrameWindow* part, set the helpId property to
10001.
- For this part, the client area requires 5 rows and 3 columns. Make
the following expandable:
- Rows 1 and 5
- Columns 1 and 3
- Add an IStaticText* part to cell (2,2). Change its label to read
Enter a contract number below:
- Add an IEntryField* part to cell (4,2) and set as follows:
- Name it AccountNumEF.
- Set the tabStop style property on.
- Set the helpId property to 10002.
- To even out button size in ButtonBar, set the packType property
of ButtonBar to expanded.
- To enable help, add an IHelpWindow* part. Set it as follows:
- Set the Help libraries property to cppwv33.hlp.
- Verify that the ipfCompatible style property is on.
- Set the Title property to Help for Opportunities Abound
Database Query
- To manage data in the IEntryField* part, add a Variable part. Name
it Contract and give it a type of OAContract*.
- Promote the this attribute of the Contract variable.
- To handle data access exceptions, add an IMessageBox* part. Name it
NotFound.
- Add one each of Factory and Variable parts. Set the type of both to
OAContractView*. Name them OAContractViewFac and OAContractViewVar,
respectively. These parts will manage a dynamic instance of
OAContractView in the finished application.
- Connect parts as follows. The connection from CancelPB to the
IFrameWindow* part was drawn when you created the part. For
simplicity's sake, this table assumes that it is the first connection
(conn0).
Table 24. Connections for OAQueryContract
| Connection number
| From Part, feature...
| To Part, feature...
|
| 1
| AccountNumEF, text
| Contract, accountNum
|
| 2
| AccountNumEF, textLength
| okPB, enabled
|
| 3
| okPB, buttonClickEvent
| Contract, getContract
|
| 4
| conn3, anAccountNum
| accountNumEF, text
|
| 5
| conn3, exceptionOccurred
| NotFound, showException
|
| 6
| Contract, this
| OAContractViewFac, contract (the promoted variable from that part)
|
| 7
| Contract, queryFound
| OAContractViewFac, new
|
| 8
| Contract, queryFound
| FrameWindow, close
|
| 9
| OAContractViewFac, newEvent
| OAContractViewVar, this
|
| 9
| OAContractViewFac, newEvent
| OAContractViewVar, setFocus
|
| 10
| OAContractViewFac, newEvent
| OAContractViewVar, show
|

Constructing OAQueryContractor
- Create a visual part as follows:
- For the base class, use IFrameWindow
- For the client type, use IMultiCellCanvas
- Name it OAQueryContractor
The part opens in the Composition Editor.
- In the IFrameWindow* part, set the helpId property to
10003.
- For this part, the client area requires 5 rows and 3 columns. Make
the following expandable:
- Rows 1 and 5
- Columns 1 and 3
- Add an IStaticText* part to cell (2,2). Change its label to read
Enter the contractor's name below:
- Add an IEntryField* part to cell (4,2) and set as follows:
- Name it ContractorIDEF.
- Set the tabStop style property on.
- Set the helpId property to 10004.
- To even out button size in ButtonBar, set the packType property
of ButtonBar to expanded.
- To enable help, add an IHelpWindow* part. Set it as follows:
- Set the Help libraries property to cppwv33.hlp.
- Verify that the ipfCompatible style property is on.
- Set the Title property to Help for Opportunities Abound
Database Query
- To manage data in the IEntryField* part, add a Variable part. Name
it Contractor and give it a type of OAContractor*.
- Promote the this attribute of the Contractor variable.
- To handle data access exceptions, add an IMessageBox* part. Name it
NotFound.
- Add one each of Factory and Variable parts. Set the type of both to
OAContractorView*. Name them OAContractorViewFac and
OAContractorViewVar, respectively. These parts will manage a dynamic
instance of OAContractorView in the finished application.
- Connect parts as follows. The connection from CancelPB to the
IFrameWindow* part was drawn when you created the part. For
simplicity's sake, this table assumes that it is the first connection
(conn0).
Table 25. Connections for OAQueryContractor
| Connection number
| From Part, feature...
| To Part, feature...
|
| 1
| ContractorIDEF, textLength
| okPB, enabled
|
| 2
| okPB, buttonClickEvent
| Contractor, parseName
|
| 3
| conn2, aName
| ContractorIDEF, text
|
| 4
| okPB, buttonClickEvent
| Contractor, getContractor
|
| 5
| conn4, aContractorID
| Contractor, contractorID
|
| 6
| conn4, exceptionOccurred
| NotFound, showException
|
| 7
| Contractor, this
| OAContractorViewFac, contractor (the promoted variable from that part)
|
| 8
| Contractor, queryFound
| OAContractViewFac, new
|
| 9
| Contractor, queryFound
| FrameWindow1, close
|
| 10
| OAContractViewFac, newEvent
| OAContractViewVar, this
|
| 11
| OAContractViewFac, newEvent
| OAContractViewVar, setFocus
|
| 12
| OAContractViewFac, newEvent
| OAContractViewVar, show
|

Constructing OAQuerySkill
- Create a visual part as follows:
- For the base class, use IFrameWindow
- For the client type, use IMultiCellCanvas
- Name it OAQuerySkill
The part opens in the Composition Editor.
- In the IFrameWindow* part, set the helpId property to
9999.
- For this part, the client area requires 5 rows and 3 columns. Make
the following expandable:
- Rows 1 and 5
- Columns 1 and 3
- Add an IStaticText* part to cell (2,2). Change its label to read
Enter a description of the skill below:
- Add an IEntryField* part to cell (4,2) and set as follows:
- Name it SkillNameEF.
- Set the tabStop style property on.
- Set the helpId property to 10000.
- To even out button size in ButtonBar, set the packType property
of ButtonBar to expanded.
- To enable help, add an IHelpWindow* part. Set it as follows:
TBD
- To manage data in the IEntryField* part, add a Variable part. Name
it Skill and give it a type of OASkill*. Promote the this
attribute of the Skill variable.
- Add an OASkillBase* part. Name it SkillBase.
- Add an IVSequence* part. Name it SkillList and set its element
template argument to OASkill*.
- Add one each of Factory and Variable parts. Set the type of both to
OASkillView*. Name them OASkillViewFac and OASkillViewVar,
respectively. These parts will manage a dynamic instance of OASkillView
in the finished application.
- Connect parts as follows. The connection from CancelPB to the
IFrameWindow* part was drawn when you created the part. For
simplicity's sake, this table assumes that it is the first connection
(conn0).
Table 26. Connections for OAQuerySkill
| Connection number
| From Part, feature...
| To Part, feature...
|
| 1
| SkillNameEF, text
| Skill, skillName
|
| 2
| SkillNameEF, textLength
| okPB, enabled
|
| 3
| okPB, buttonClickEvent
| SkillBase, getSkill
|
| 4
| conn3, aSkillName
| Skill, SkillName
|
| 5
| conn3, aList
| SkillList, this
|
| 6
| SkillBase, queryFound
| FrameWindow1, close
|
| 7
| Skill, this
| OASkillViewFac, skill (the promoted variable from that part)
|
| 8
| SkillBase, this
| OASkillViewFac, SkillBase (the promoted variable from that part)
|
| 9
| SkillList, this
| OASkillViewFac, SkillList (the promoted variable from that part)
|
| 10
| SkillBase, queryFound
| OASkillViewFac, new
|
| 11
| OASkillViewFac, newEvent
| OASkillViewVar, this
|
| 12
| OASkillViewFac, newEvent
| OASkillViewVar, setFocus
|
| 13
| OASkillViewFac, newEvent
| OASkillViewVar, show
|
Working with Parts in the Composition Editor
Editing Part Properties
Dropping Parts in the Composition Editor
About Promoting Part Features
Making Connections in the Composition Editor
Factory
IHelpWindow
IMessageBox
Variable
