home *** CD-ROM | disk | FTP | other *** search
- #include <iframe.hpp>
- #include <icmdhdr.hpp>
- #include <ientryfd.hpp>
- #include <ititle.hpp>
- #include <istattxt.hpp>
- #include <idate.hpp>
- #include <itime.hpp>
- #include <icnr.hpp>
- #include <istring.hpp>
- #include <iiconctl.hpp>
-
- class IResourceId;
- class IResourceLibrary;
- class IContainerControl;
-
- #define FIELDOFFSET2(type, field) ((long)&(((type *)0)->field))
-
- extern "C"
- {
- #include <string.h>
-
- void loadContainer(IContainerControl& pcnrctl);
- }
-
-
-
- /**********************************************************/
- /* Define our Customer Container Window. */
- /**********************************************************/
- class CustomerList : public IFrameWindow, public ICommandHandler
- {
-
- public:
-
- CustomerList(const IRectangle& rect,
- Boolean fLoadObjects=true);
- ~CustomerList() {;}
-
- Boolean loadObjects() { return fLoadObjects; }
- IContainerColumn* colIcon() { return &cnrcolIcon; }
- IContainerColumn* colName() { return &cnrcolName; }
- IContainerColumn* colAddress() { return &cnrcolAddress; }
- IContainerColumn* colPhone() { return &cnrcolPhone; }
- IContainerColumn* colAge() { return &cnrcolAge; }
- IContainerColumn* colOrderDate() { return &cnrcolOrderDate; }
- IContainerColumn* colOrderTime() { return &cnrcolOrderTime; }
- IContainerControl& container() { return *_pcnrCustList; }
- IContainerControl& objectList() { return *_pObjectList; }
- IStaticText& statusArea() { return *_pStatusLine; }
-
- protected:
- virtual Boolean command(ICommandEvent& cmdevt);
-
- private:
- IContainerControl* _pcnrCustList;
- IContainerControl* _pObjectList;
- ITitle* _pTitle;
- IIconControl* _pTitleIcon;
- IStaticText* _pStatusLine;
- IContainerColumn cnrcolIcon;
- IContainerColumn cnrcolName;
- IContainerColumn cnrcolAddress;
- IContainerColumn cnrcolPhone;
- IContainerColumn cnrcolAge;
- IContainerColumn cnrcolOrderDate;
- IContainerColumn cnrcolOrderTime;
- Boolean fLoadObjects;
- };
-
-
-
-
- /**********************************************************/
- /* Define the data record for our container objects */
- /**********************************************************/
- class Customer : public IContainerObject
- {
- friend CustomerList;
- public:
- Customer(const IString& strName,
- const IPointerHandle& hptrIcon = 0,
- const IString& strAddress = IString(),
- const IString& strPhone = IString(),
- unsigned long ulAge = 0);
-
- Customer(Customer&);
-
- ~Customer();
-
-
-
- virtual void handleOpen(IContainerControl* pcnrctl);
- void setCustomerName(const IString& strCustomer)
- { strCustomerName = strCustomer; }
- void setCustomerAddress(const IString& strAddress)
- { strCustomerAddress = strAddress; }
- void setCustomerPhone(const IString& strPhone)
- { strCustomerPhone = strPhone; }
- void setCustomerAge(unsigned long ulAge)
- { ulCustomerAge = ulAge; }
- void setOrderDate(const IDate& timeOrder);
- void setOrderTime(const ITime& timeOrder);
-
- IString customerName() const
- { return strCustomerName; }
- IString customerAddress() const
- { return strCustomerAddress; }
- IString customerPhone() const
- { return strCustomerPhone; }
- unsigned long customerAge() const
- { return ulCustomerAge; }
-
- IContainerObject* objectCopy();
-
- private:
- IString strCustomerName;
- IString strCustomerAddress;
- IString strCustomerPhone;
- unsigned long ulCustomerAge;
- IString strOrderDate;
- IString strOrderTime;
- };
-
-
-
- extern "C"
- {
- long _System pfncompName(const Customer* p1,
- const Customer* p2,
- const IContainerControl* pcnrctl);
-
- long _System pfncompAddress(const Customer* p1,
- const Customer* p2,
- const IContainerControl* pcnrctl);
-
- long _System pfncompPhone(const Customer* p1,
- const Customer* p2,
- const IContainerControl* pcnrctl);
-
- long _System pfncompAge(const Customer* p1,
- const Customer* p2,
- const IContainerControl* pcnrctl);
-
- Boolean _System pfnfilterA_K(const Customer* pcust,
- const IContainerControl* pcnrctl);
-
- Boolean _System pfnfilterL_Z(const Customer* pcust,
- const IContainerControl* pcnrctl);
-
- Boolean _System pfnfilterOver30(const Customer* pcust,
- const IContainerControl* pcnrctl);
- }