home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************/
- /* Sample Program for IBMCLASS - Client Classes implementation */
- /* */
- /* Change History: */
- /* Rel Programmer Stamp Date Description */
- /* --- ----------------- ----- -------- --------------------------------- */
- /* 3.1 Philippe Gregoire PHG 10/09/92 Creation for demo */
- /**************************************************************************/
-
- // include IBMCLASS classes definitions
- #include <irect.hpp> // IRectangle
- #include <ireslib.hpp> // IResourceLibrary/IResourceId
-
- // include our own class definitions
- #include "wincl.hpp"
- #include "win.h"
-
- /**************************************************************************/
- /* MyClientWindow :: MyClientWindow PHG 10/09 */
- /* Construct our client window */
- /**************************************************************************/
- MyClientWindow :: MyClientWindow(unsigned long windowId,
- const IWindow* parowWindow) :
- IStaticText(windowId,parowWindow,parowWindow,IRectangle())
- {unsigned long ulX=20;
- ISize sizStat=ISize(100,20);
- ISize sizEF=ISize(200,20);
-
- // create our subcomponents
- psttxtName = new IStaticText(ST_NAME, this, this, IRectangle(IPoint(20, 190),sizStat));
- pefName = new IEntryField(EF_NAME, this, this, IRectangle(IPoint(130,190),sizEF));
- psttxtNumber = new IStaticText(ST_NUMBER, this, this, IRectangle(IPoint(20, 150),sizStat));
- pefNumber = new IEntryField(EF_NUMBER, this, this, IRectangle(IPoint(130,150),sizEF));
- pgbxAddress = new IGroupBox( GB_ADDRESS, this, this, IRectangle(IPoint(10, 50),ISize(340,90)));
- psttxtAddress = new IStaticText(ST_ADDRESS, this, this, IRectangle(IPoint(20, 90),sizStat));
- pefAddress = new IEntryField(EF_ADDRESS, this, this, IRectangle(IPoint(130,90),sizEF));
- psttxtState = new IStaticText(ST_STATE, this, this, IRectangle(IPoint(20, 60),ISize(50,20)));
- pefState = new IEntryField(EF_STATE, this, this, IRectangle(IPoint(80, 60),ISize(50,20)));
- psttxtZip = new IStaticText(ST_ZIP, this, this, IRectangle(IPoint(140, 60),ISize(100,20)));
- pefZip = new IEntryField(EF_ZIP, this, this, IRectangle(IPoint(250, 60),ISize(50,20)));
-
- // set labels text
- psttxtName->setText(IResourceId(STR_NAMELAB));
- psttxtNumber->setText(IResourceId(STR_NUMBERLAB));
- pgbxAddress->setText(IResourceId(STR_ADDRESSLAB));
- psttxtAddress->setText(IResourceId(STR_STREETLAB));
- psttxtState->setText(IResourceId(STR_STATELAB));
- psttxtZip->setText(IResourceId(STR_ZIPLAB));
-
- }/* end MyClientWindow :: MyClientWindow(...) */
-
- /**************************************************************************/
- /* MyClientWindow :: setCustomer PHG 10/09 */
- /* Set a customer from resource */
- /**************************************************************************/
- long MyClientWindow :: setCustomer(long lCustomer)
- {
- if(lCustomer<MIN_CUST) lCustomer=MIN_CUST;
- if(lCustomer>MAX_CUST) lCustomer=MAX_CUST;
-
- pefName->setText(IResourceId(STR_CUSTBASE+MULT_CUST*lCustomer+NAM_CUST));
- pefNumber->setText(IResourceId(STR_CUSTBASE+MULT_CUST*lCustomer+NUM_CUST));
- pefAddress->setText(IResourceId(STR_CUSTBASE+MULT_CUST*lCustomer+ADD_CUST));
-
- return(lCustomer);
- }/* end MyClientWindow :: setCustomer(...) */
-
- /**************************************************************************/
- /* MyClientWindow :: nextCustomer PHG 11/09 */
- /* */
- /**************************************************************************/
- IString MyClientWindow :: nextCustomer()
- {
- lCurCustomer=setCustomer(++lCurCustomer);
- return(statCust());
- }/* end MyClientWindow :: nextCustomer(...) */
-
- /**************************************************************************/
- /* MyClientWindow :: previousCustomer PHG 11/09 */
- /* */
- /**************************************************************************/
- IString MyClientWindow :: previousCustomer()
- {
- lCurCustomer=setCustomer(--lCurCustomer);
- return(statCust());
- }/* end MyClientWindow :: previousCustomer(...) */
-
- /**************************************************************************/
- /* MyClientWindow :: statCust PHG 11/09 */
- /* Returns the customer status */
- /**************************************************************************/
- IString MyClientWindow :: statCust() const
- {
- return(IString(lCurCustomer)+" / "+IString(MAX_CUST));
-
- }/* end MyClientWindow :: statCust(...) */
-