Boolean QFMotionPlayer::windowResize(IResizeEvent &event) { IRectangle screenRectangle; if (screen) { screenRectangle = (qf.controller() ? IRectangle(IPoint(0, CONTROL_PANEL_HEIGHT), IPoint(event.newSize())) : IRectangle(event.newSize())); screen->moveSizeTo(screenRectangle); if (movieWindow) { IRectangle movieRectangle = IRectangle(screenRectangle.size()); if (qf.scale() == QF_SCALE_CENTER && moviePlayer && howLongMovieWillPlay) movieRectangle = IRectangle(((IMMDigitalVideo*)moviePlayer)->videoFileWidth(), ((IMMDigitalVideo*)moviePlayer)->videoFileHeight()). centeredAt(movieRectangle.center()); movieWindow->moveSizeTo(movieRectangle); } } if (qf.controller()) { float armPercent = .0; if (filePrepared && !isPlaying && moviePlayer->position()) { armPercent = moviePlayer->position(); armPercent /= howLongMovieWillPlay; } qf.createController(armPercent); } return false; }
P_Crop::P_Crop( IWindow *dlg ) : ISetCanvas( P_CROP, dlg, dlg, IRectangle(), (ISetCanvas::classDefaultStyle | ISetCanvas::decksByGroup | ISetCanvas::packEven) & ~ISetCanvas::packTight ), enableCBx( P_CROP_ENABLE_CBX, this, this, IRectangle(), ICheckBox::classDefaultStyle | IControl::group | IControl::tabStop ) { // initialize variables resetVariables(); // force a groupbox around the canvas setText( "Crop" ).disableGroup(); // set the enable/disable checkbox enableCBx.setText( "enable" ); // setup handlers ISelectHandler:: handleEventsFor( &enableCBx ); ICommandHandler:: handleEventsFor( this ); IMenuHandler:: handleEventsFor( this ); IMenuHandler:: handleEventsFor( &enableCBx ); return; }
void QFMotionPlayer::setWindow(IWindow& window) { window_p = &window; handler.IResizeHandler::handleEventsFor(window_p); handler.IPaintHandler::handleEventsFor(window_p); handler.ICommandHandler::handleEventsFor(window_p); handler.QFPlayerHandler::handleEventsFor(window_p); menu = new IPopUpMenu(IResourceId(MOTION_POPUP_ID, QuickFlick::resourceLibrary()), window_p); menu->disableItem(MI_MOTION_SAVEAS); IRectangle screenRectangle = (qf.controller() ? IRectangle(IPoint(0, CONTROL_PANEL_HEIGHT), IPoint(window_p->size())) : IRectangle(window_p->size())); screen = new IStaticText(SCREEN_ID, window_p, window_p, screenRectangle, IWindow::noStyle | IWindow::clipChildren); screen->setFillColor(IColor::paleGray); screen->setBackgroundColor(IColor::paleGray); screen->enableFillBackground(); screen->setAlignment(IStaticText::topLeftWrapped); screen->setFont(IFont("Helv", 8)); if (qf.disabled()) setScreenText("This version of QuickFlick has expired.\nTo upgrade:\n - Open Netscape\n - Choose Help->About Plug-ins->Practice"); handler.IMenuHandler::handleEventsFor(screen); screen->show(); }
// Konstruktor f�r geschachtelte MDI-Fenster MDIFrame (const IResourceId &r, IFrameWindow *parent, const char *title = 0, const IRectangle &rec = IRectangle (), const IFrameWindow::Style &s = defaultStyle () &~ windowList | alignNoAdjust) : IFrameWindow (r, parent->client (), parent->client (), rec == IRectangle () ? IRectangle (IPoint (), parent->client ()->size ()) : rec, s, title), Client (0x8008, this, this) { setClient (&Client); }
LProdInfoDialog::LProdInfoDialog( IWindow *owner ) :IFrameWindow( ID_PRODINFO, IWindow::desktopWindow(), owner, IRectangle(), IFrameWindow::systemMenu | IFrameWindow::dialogBackground | IFrameWindow::dialogBorder ) ,canvas( ID_PRODINFO_CANVAS, this, this ) ,iconCtl( ID_PRODINFO_ICON, &canvas, &canvas ) ,text1( ID_PRODINFO_TEXT1, &canvas, &canvas ) ,text2( ID_PRODINFO_TEXT2, &canvas, &canvas ) ,text3( ID_PRODINFO_TEXT3, &canvas, &canvas ) ,text4( ID_PRODINFO_TEXT4, &canvas, &canvas ) ,text5( ID_PRODINFO_TEXT5, &canvas, &canvas ) ,button( ID_PRODINFO_OK, &canvas, &canvas ) { // Set self as command event handler handleEventsFor(this); // Set text for the controls iconCtl.setIcon( ID_MAIN ); text1.setText( IResourceId( STR_MAIN_TITLE ) ); text1.setForegroundColor( IColor::kRed ); text2.setText( IResourceId( STR_PRODINFO_TEXT2 ) ); text3.setText( IResourceId( STR_PRODINFO_TEXT3 ) ); text4.setText( IResourceId( STR_PRODINFO_TEXT4 ) ); text5.setText( IResourceId( STR_PRODINFO_TEXT5 ) ); button.setText( IResourceId( STR_OK ) ); // Set the canvas orientation to veritical // Set the canvas alignment to center all the controls canvas.setDeckOrientation( ISetCanvas::vertical ); canvas.setAlignment( ISetCanvas::centerCenter ); // Set the client as the canvas setClient( &canvas ); /*----------------------------------------------------------------------------- | Resize the window based on the minimum size of the canvas | -----------------------------------------------------------------------------*/ moveSizeToClient( IRectangle( IPoint( IWindow::desktopWindow()->size().width()/2, IWindow::desktopWindow()->size().height()/2 ), canvas.minimumSize() ) ); /*----------------------------------------------------------------------------- | Center the frame window | -----------------------------------------------------------------------------*/ moveSizeTo( rect().centerAt( IWindow::desktopWindow()->rect().center() ) ); /*----------------------------------------------------------------------------- | Show the dialog window | -----------------------------------------------------------------------------*/ setFocus(); show(); }
/****************************************************************************** * Class AccountPage :: AccountPage - Constructor for the account page * * * * Define yourself as an IMultiCellCanvas * * Create generic page buttons * * Create generic page container buttons * * Create static text for the user ID * * Create static text for the node * * Create entryfield for the user ID * * Create entryfield for the node * * Define a null container pointer * * Define a null container object pointer * * Define a null container column pointer * * Define a null container column pointer * * Create an account data object given the key * * Create a empty account data object * * Set the key in your private data * * Set the isQuery in your private data * * Create the notebook page settings * * Create a select handler and later attach to the container * ******************************************************************************/ AccountPage::AccountPage( IWindow* pParent, const IString& aKey ) :IMultiCellCanvas ( ID_ACCOUNT_PAGE, pParent, pParent ), pageButtons ( ID_ACCOUNT_PAGE_BUTTONS, this, this, false ), pageCnrButtons ( ID_ACCOUNT_PAGE_CNRBUTTONS, this, this, false ), userIdText ( ID_NO_ITEM, this, this ), nodeSysText ( ID_NO_ITEM, this, this ), userId ( ID_ACC_USERID_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), nodeSys ( ID_ACC_NODESYS_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop ), pCnr ( (IContainerControl*) NULL ), pAcctCnrObj ( (AcctCnrObj*) NULL ), pColUserID ( (IContainerColumn*) NULL ), pColNodeSys ( (IContainerColumn*) NULL ), acctData ( aKey ), origAcctData (), Key ( aKey ), isAquery ( false ), thePageSettings ( IApplication::current().userResourceLibrary(). loadString( STR_ACC_ACCOUNT_TAB ), NULL, INotebook::PageSettings::autoPageSize | INotebook::PageSettings::majorTab ), cnrSelHandler ( this ) { /*----------------------------------------------------------------------------- | Save the account data to another object in case the user wishes to | | undo any changes. | | Label the static text objects. | | Set the limit for the entryfields. | -----------------------------------------------------------------------------*/ origAcctData = acctData; userIdText.setText( STR_ACC_USERID ); nodeSysText.setText( STR_ACC_NODESYS ); userId.setLimit( DISPLAY_LARGE ); nodeSys.setLimit( DISPLAY_LARGE ); /*----------------------------------------------------------------------------- | Fill the container from the database. | | Set the objects on yourself (IMultiCellCanvas). | | Start handling the events. | -----------------------------------------------------------------------------*/ fillCnr(); setCells(); handleIt(); };
//************************************************************************** // AServerWindow :: AServerWindow - Constructor for our main window //************************************************************************** AServerWindow :: AServerWindow(unsigned long windowId) : IFrameWindow (windowId), //Call IFrameWindow constructor statusLine(WND_STATUS, this, this), //Create status line todoStatus(WND_TODOSTA, &statusLine,//Create todo status line &statusLine), workStatus(WND_WORKSTA, &statusLine,//Create work status line &statusLine), doneStatus(WND_DONESTA, &statusLine,//Create done status line &statusLine), cArea(WND_CAREA, this, this), //Create Client Area dArea(WND_DAREA, &cArea, this), //Create Data Area Cannvas todoList(WND_TODO, &dArea, this, //Create todo list IRectangle(), // (IListBox::defaultStyle() // Use default style with | IListBox::noAdjustPosition)), // Canvas controling size workList(WND_WORK, &dArea, this, //Create working list IRectangle(), // (IListBox::defaultStyle() // | IListBox::noAdjustPosition)), // Allow the Canvas to control size doneList(WND_DONE, &dArea, this, //Create done list IRectangle(), // (IListBox::defaultStyle() // Use default style with | IListBox::noAdjustPosition)), // Canvas controling size mle(WND_MLE, &cArea, &cArea), //Create MLE to display DDE activities infoArea(this), //Create Information Area resLib(), //Resource library server(resLib.loadString( MI_APP ), //Create DDE Server (application name, resLib.loadString( MI_TOPIC ), // topic name, window) this ) { hot=0; //Hot link not active cArea.setOrientation( //Set the orientation ISplitCanvas::horizontalSplit); // to horizontal setIcon( id() ); //Set the icon setClient(&cArea); //Set Client to cArea addExtension(&statusLine, //Add Status Line above the client IFrameWindow::aboveClient, // and specify the height IFont(&statusLine).maxCharHeight());// and specify height setExtensionSize(&infoArea, // IFont(&infoArea).maxCharHeight());//and specify height infoArea.setDefaultText(STR_HOTNO); //Set information area text from RC sizeTo(ISize(600,400)); //Set the size of main window moreTodo(); //Initialize the todo list updateStatus(); //Update status line setFocus(); //Set Focus to main window show(); } /* end AServerWindow :: AServerWindow(...) */
void Game::renderScreen() { m_currentCam->setAsCamera(); renderScene(false); PlaneObject *plane = objects->getPlaneObject(); if(plane != NULL) { //render plane reticles plane->renderReticle(15.0f, 1.3f); plane->renderReticle(8.0f, 1.0f); if (plane->isPlaneAlive() == false) { int textY = gRenderer.getScreenY()/2; IRectangle rect = IRectangle(0,textY,gRenderer.getScreenX()-1, textY + 30); gRenderer.drawText("Press \"Space Bar\" to Respawn",&rect, eTextAlignModeCenter, false); } } gConsole.render(); if (GameBase::m_renderInfo) GameBase::renderInfo(); }
strgen::strgen( unsigned long id, IWindow* parent, IWindow* owner, const IRectangle& rect, const IFrameWindow::Style& style, const char* title) : IFrameWindow((partWindowId) ? partWindowId : id, parent, owner, rect, style, title) { partWindowId = (partWindowId) ? partWindowId : id; iCanvas = new ICanvas( IC_FRAME_CLIENT_ID, this, this, IRectangle()); iCollectionViewListBox1 = new ICollectionViewListBox< Customer*, IVSequence< Customer* > >( partWindowId+WNDOFFSET_strgen_CollectionViewListBox1, iCanvas, iCanvas, IRectangle(IPoint(65,107),ISize(383, 183)), IBaseListBox::defaultStyle ( ), IStringGenerator<Customer*>(new strgen::strgenFn())); iStaticText1 = new IStaticText( partWindowId+WNDOFFSET_strgen_StaticText1, iCanvas, iCanvas, IRectangle(IPoint(70,296),ISize(285, 25))); iCustomer1 = new Customer(); iCustomer2 = new Customer(); iVSequence1 = new IVSequence< Customer* >(); conn0 = new strgenConn0(); conn1 = new strgenConn1(); conn2 = new strgenConn2(); this->setFocus(); this->setClient(iCanvas); iStaticText1->setText("Customer - CollectionViewListBox"); iCustomer1->setName("John Smith"); iCustomer1->setStreet("123 42nd Street"); iCustomer1->setPhone("512-235-8212"); iCustomer1->setCity("NewYork"); iCustomer2->setName("Mike Lawrence"); iCustomer2->setStreet("88 Columbus Ave"); iCustomer2->setPhone("416-123-8888"); iCustomer2->setCity("Ajax"); } //end constructor
/****************************************************************************** * Class AListBox :: AListBox - constructor for main window * * * * Define itself as an IFrame Window * * Create a listbox. * * Create the trace listbox. * * Create the info area, the status line, and the menu bar. * ******************************************************************************/ AListBox :: AListBox(unsigned long windowId) : IFrameWindow( IFrameWindow::defaultStyle() | IFrameWindow::accelerator | IFrameWindow::minimizedIcon, windowId), listbox(WND_HELLO, this, this, IRectangle(), //Create listbox (IListBox::defaultStyle() | IListBox::multipleSelect) & ~IListBox::horizontalScroll), listbox2(WND_HELLO, this, this, IRectangle(), //Create trace listbox IListBox::defaultStyle() & ~IListBox::horizontalScroll), infoArea(this), statusLine(WND_STATUS, this, this), menuBar(WND_MAIN, this), commandhandler(this,&listbox) { /*----------------------------------------------------------------------------| | Set the alignment of the status line and add it to the frame extension. | -----------------------------------------------------------------------------*/ statusLine.setAlignment( IStaticText::centerLeft); addExtension(&statusLine, IFrameWindow::aboveClient, 30UL); setStatus(); /*----------------------------------------------------------------------------| | Add the listbox as an extension 1/2 the size of the client and set the | | trace listbox as the rest of the client space. | -----------------------------------------------------------------------------*/ addExtension(&listbox, IFrameWindow::leftOfClient, 0.5); setClient(&listbox2); commandhandler.handleEventsFor(this); /*----------------------------------------------------------------------------| | Set the size of the main window, update the main window, set focus and then | | show the main window. | -----------------------------------------------------------------------------*/ sizeTo(ISize(400,300)); update(); setFocus(); show(); } /* end AListBox :: AListBox(...) */
ToolButton (unsigned long id, IWindow *parent, const IPointerHandle &pict) : IGraphicPushButton (id, parent, parent, pict, IRectangle (IPoint (), ISize (20, 20)), // verkleinere Grafik falls n�tig defaultStyle () | sizeToGraphic) // ISetCanvas benutzt Minimumgr��e um Controls zu // Positionieren { setMinimumSize (ISize (30, 30)); }
void NSearchDialog::loadFromProfile(IProfile& profile) { // Dialog options profile.setDefaultApplicationName("SEARCH"); irProfileRectangle=IRectangle(profile.integerWithKey("MINX") ,profile.integerWithKey("MINY") ,profile.integerWithKey("MAXX") ,profile.integerWithKey("MAXY")); ifProfileFont=IFont(profile.elementWithKey("FONTNAME") ,profile.integerWithKey("FONTSIZE")); // Done }
StandardWindow::StandardWindow() :IFrameWindow( "NewShow: A C++ Dive class sample.", 1001 ) { pDiveWindow = new DiveWindow( 1002, this, this ); setClient( pDiveWindow ); sizeTo( frameRectFor(IRectangle(pDiveWindow->getSize().width(), pDiveWindow->getSize().height())).size() ); setFocus(); show(); sendEvent( IEvent(pDiveWindow, WM_VRNENABLED, 0, 0) ); }
/*------------------------------------------------------------------------------ | DrawingArea::DrawingArea | | | | | ------------------------------------------------------------------------------*/ DrawingArea::DrawingArea( unsigned long id, IWindow* parent, IWindow* owner, const IRectangle& rect ) : IDrawingCanvas( id, parent, owner, rect ), gc(handle()), currentfont(), currentBundle(), currentBitmap(), dState( notDrawing ), currentObj( move ), iGraphic(0), moveGraphic(0), moveRect(IRectangle()), startingPt(), previousPt(), tempPt(), pointCount(0), flyOverHandler(0) { currentBundle.setPenColor(IGraphicContext::defaultPenColor()) .setFillColor(IGraphicContext::defaultFillColor()) .setMixMode(IGraphicContext::defaultMixMode()) .setPenJoiningStyle(IGraphicBundle::miter) .setDrawOperation( IGraphicBundle::fillAndFrame ); gc.setMixMode( IGraphicBundle::xor ).setPenColor( IColor::white ) .setFillColor( IColor::white ) .setDrawOperation( IGraphicBundle::frame ) .setHitApertureSize( ISize(2,2) ); setGraphicContext( &gc ); setGraphicList( new IGList() ); // Load the pointers. // IResourceLibrary reslib; IDynamicLinkLibrary reslib("CPPWV53R"); ptrLine = reslib.loadPointer( POINTER_LINE ); ptrFreehand = reslib.loadPointer( POINTER_FREEHAND ); ptrRectangle = reslib.loadPointer( POINTER_RECTANGLE ); ptrEllipse = reslib.loadPointer( POINTER_ELLIPSE ); ptrPolyline = reslib.loadPointer( POINTER_POLYLINE ); ptrPolygon = reslib.loadPointer( POINTER_POLYGON ); ptrArc = reslib.loadPointer( POINTER_ARC ); ptrPie = reslib.loadPointer( POINTER_PIE ); ptrChord = reslib.loadPointer( POINTER_CHORD ); ptrText = reslib.loadPointer( POINTER_TEXT ); ptrBitmap = reslib.loadPointer( POINTER_BITMAP ); ptrStyleCan = reslib.loadPointer( POINTER_STYLECAN ); ptrEraser = reslib.loadPointer( POINTER_ERASER ); ((IMouseHandler*)this)->handleEventsFor(this); }
/////F setupButtons @ @ terminal protected instance Boolean AHelloWindow5 :: setupButtons() { ISetCanvas * buttons; IPushButton * helpButton; buttons=new ISetCanvas(WND_BUTTONS, this, this) ; buttons->setMargin(ISize()); buttons->setPad(ISize()); leftButton=new IPushButton(MI_LEFT, buttons, buttons, IRectangle(), IPushButton::defaultStyle() | IControl::tabStop); leftButton->setText(STR_LEFTB); centerButton=new IPushButton(MI_CENTER, buttons, buttons, IRectangle(), IPushButton::defaultStyle() | IControl::tabStop); centerButton->setText(STR_CENTERB); rightButton=new IPushButton(MI_RIGHT, buttons, buttons, IRectangle(), IPushButton::defaultStyle() | IControl::tabStop); rightButton->setText(STR_RIGHTB); helpButton=new IPushButton(MI_HELP, buttons, buttons, IRectangle(), IPushButton::defaultStyle() | IPushButton::help | IButton::noPointerFocus | IControl::tabStop); helpButton->setText(STR_HELPB); addExtension(buttons, IFrameWindow::belowClient, 30UL); return true; }
NSearchDialog::NSearchDialog(IWindow* piwOwner,NMankind* pSetNMankind) : IFrameWindow(IResourceId(ID_NSearchDialog) ,IWindow::desktopWindow() ,piwOwner ,IRectangle() ,IFrameWindow::systemMenu |IFrameWindow::dialogBackground |IFrameWindow::dialogBorder |IFrameWindow::titleBar |IFrameWindow::noMoveWithOwner ,"Search") , IFrameHandler() { // SetUp Data setIcon(RES_IconFTree); pNSearchDialog=this; bDisabled=False; pNMankind=pSetNMankind; setAutoDeleteObject(true); // Layout pNSearch = new NSearch(1,this,this); setClient(pNSearch); NMainWindow::pNMainWindow->ihwHelp.setAssociatedWindow(this); // SetUp Position & Size & Font setFont(ifProfileFont); ISize is=pNSearch->minimumSize(); IPoint pos=irProfileRectangle.minXMinY(); if (pos==IPoint(0,0)) pos=NMainWindow::pNMainWindow->rect().centerXCenterY()-is/2; moveSizeToClient(IRectangle(pos,is)); // Handler IFrameWindow ::removeDefaultHandler(); // Remove DefaultFrameHandler for my one IFrameHandler ::handleEventsFor (this); // Done show(); setFocus(); }
/////F setupClient @ @ terminal protected instance Boolean AHelloWindow5 :: setupClient() { clientWindow=new ISplitCanvas( WND_CANVAS, this, this); setClient(clientWindow); helloCanvas=new ISplitCanvas( WND_HCANVAS, clientWindow, clientWindow); helloCanvas->setOrientation( ISplitCanvas::horizontalSplit); hello=new IStaticText(WND_HELLO, helloCanvas, helloCanvas); hello->setText(STR_HELLO); earthWindow = new AEarthWindow (WND_EARTH, helloCanvas); hello->setAlignment( IStaticText::centerCenter); listBox=new IListBox(WND_LISTBOX, clientWindow, clientWindow, IRectangle(), IListBox::defaultStyle() | IControl::tabStop | IListBox::noAdjustPosition); listBox->addAscending("Hello, World!"); listBox->addAscending("Hi, World!"); listBox->addAscending("Howdy, World!"); listBox->addAscending("Alo, Mundo!"); listBox->addAscending("Ola, Mondo!"); listBox->addAscending("Hallo wereld!"); listBox->addAscending("Hallo Welt!"); listBox->addAscending("Bonjour le monde!"); ISelectHandler::handleEventsFor(listBox); clientWindow->setSplitWindowPercentage( helloCanvas, 60); clientWindow->setSplitWindowPercentage( listBox, 40); return true; }
//***************************************************************************** // CLASS EmployeeType - EmployeeType - constructor //***************************************************************************** EmployeeType :: EmployeeType(IWindow* pParent ) : ISetCanvas(ID_EMPLOYEE_TYPE_GROUP_BOX, pParent, pParent, IRectangle(), defaultStyle() ), reg(ID_GEN_REG_BT, this, this), mgr(ID_GEN_MGR_BT, this, this), sup(ID_GEN_SUP_BT, this, this) { reg.setText(STR_GEN_REG_TEXT); mgr.setText(STR_GEN_MGR_TEXT); sup.setText(STR_GEN_SUP_TEXT); setText(STR_GEN_EMPLOYEE_TYPE_TEXT); setDeckOrientation(ISetCanvas::horizontal); // a regular employee is the default reg.select(); }
CodeWindow :: CodeWindow ( const char* title, unsigned long id ) : IFrameWindow ( title, id ), mle( ID_CLIENT, this, this, IRectangle(), IMultiLineEdit::verticalScroll | IMultiLineEdit::horizontalScroll ) { // Make the MLE the client window. this->setClient( &mle ); // Read this source file into the MLE, and scroll to // the top of the file. mle.importFromFile( __FILE__ ); mle.setCursorAtLine( 0 ); // Add a menu bar and attach the command handler // that will process selections from it. IMenuBar menuBar( ID_MENUBAR, this ); menuBar.setAutoDestroyWindow( false ); cmdHandler.handleEventsFor( this ); }
void main ( ) { // Create a primary window that contains a read-only MLE. IFrameWindow primary( "Getting Started - Version 1" ); IMultiLineEdit mle( 0x8008, &primary, &primary, IRectangle(), IMultiLineEdit::verticalScroll | IMultiLineEdit::horizontalScroll | IMultiLineEdit::readOnly ); primary.setClient( &mle ); // Read this source file into the MLE, and scroll to // the top of the file. mle.importFromFile( __FILE__ ); mle.setCursorAtLine( 0 ); // Set the input focus, and show the window. primary.setFocus(); primary.show(); // Display the window until the user closes it. IApplication::current().run(); }
void StatePlaying::renderScreen() { // render the entire scene renderScene(); PlaneObject* plane = m_objects->getPlaneObject(); if (plane != NULL) { //render plane reticles plane->renderReticle(15.0f, 1.3f); plane->renderReticle(8.0f, 1.0f); if (plane->isPlaneAlive() == false) { int textY = gRenderer.getScreenY()/2; IRectangle rect = IRectangle(0,textY,gRenderer.getScreenX()-1, textY + 30); gRenderer.drawText("Press \"Space Bar\" to Respawn",&rect, eTextAlignModeCenter, false); } } // render FPS and console ontop of everything gGame.GameBase::renderConsoleAndFPS(); }
//***************************************************************************** // CLASS GeneralPage - Contructor //***************************************************************************** GeneralPage :: GeneralPage(IWindow* pParent, const IString empNum) : IMultiCellCanvas(ID_GENERAL_PAGE, pParent, pParent), employeeData(empNum ), pageButtons(ID_GENERAL_PAGE_BUTTONS, this,this, false), employeeIdText (ID_NO_ITEM, this, this ), lastNameText (ID_NO_ITEM, this, this ), firstNameText (ID_NO_ITEM, this, this ), middleNameText (ID_NO_ITEM, this, this ), intPhoneText (ID_NO_ITEM, this, this ), extPhoneText (ID_NO_ITEM, this, this ), roomText (ID_NO_ITEM, this, this ), deptText (ID_NO_ITEM, this, this ), bldgText (ID_NO_ITEM, this, this ), divText (ID_NO_ITEM, this, this ), mgrEmpNumText (ID_NO_ITEM, this, this ), mgrEmpNameText (ID_NO_ITEM, this, this ), employeeId (ID_GEN_EMPLOYEE_ID_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), lastName (ID_GEN_LAST_NAME_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), firstName (ID_GEN_FIRST_NAME_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), middleInitial (ID_GEN_MIDDLE_INITIAL_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), intPhone (ID_GEN_INT_PHONE_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), extPhone (ID_GEN_EXT_PHONE_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), room (ID_GEN_ROOM_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), building (ID_GEN_BUILDING_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), deptName (ID_GEN_DEPT_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), division (ID_GEN_DIVISION_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), employeeType (this), mgrEmpId (ID_GEN_MGR_EMP_ID_EF, this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), mgrName (ID_GEN_MGR_NAME_EF , this, this, IRectangle(), IEntryField::classDefaultStyle | IControl::tabStop), Key(empNum), thePageSettings( IApplication::current().userResourceLibrary().loadString( STR_GEN_GENERAL_TAB), NULL, INotebook::PageSettings::autoPageSize | INotebook::PageSettings::majorTab ), isAquery(false) { // set up the fields setUp(); if ( employeeId.text().length() ) employeeId.disableDataUpdate(); // set up the page setCells(); // populate the page from any database info displayData(); handleIt(); }
/*------------------------------------------------------------------------------ | Amp::Amp | | | | | ------------------------------------------------------------------------------*/ Amp::Amp( IMMAmpMixer* aAmp1, IMMAmpMixer* aAmp2, IMMAmpMixer* aAmp3, unsigned long windowid, IWindow* parent, IWindow* owner) : IMultiCellCanvas(windowid,parent,owner), name (AMPNAMEID, this,owner), slVolume (SL_VOLUME_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slBalance (SL_BALANCE_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slBass (SL_BASS_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slTreble (SL_TREBLE_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slPitch (SL_PITCH_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slGain (SL_GAIN_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), pAmpMixer1(aAmp1), pAmpMixer2(aAmp2), pAmpMixer3(aAmp3), ampHandler() { IResourceLibrary reslib; //Set up the title name.setText(reslib.loadString(TITLE_MIXER)); name.setForegroundColor ( IColor(IColor::kRed) ); slVolume.setArmRange (IRange(0,100)); slVolume.setRotationIncrement (10); slVolume.setTickSpacing (1); slVolume.setText (reslib.loadString(STR_VOLUME)); addToCell (&slVolume, 1, 1, 1, 1); slBalance.setArmRange (IRange(0,100)); slBalance.setRotationIncrement(10); slBalance.setTickSpacing (1); slBalance.setText (reslib.loadString(STR_BALANCE)); addToCell (&slBalance, 2, 1, 1, 1); slBass.setArmRange (IRange(0,100)); slBass.setRotationIncrement (10); slBass.setTickSpacing (1); slBass.setText (reslib.loadString(STR_BASS)); addToCell (&slBass, 3, 1, 1, 1); slTreble.setArmRange (IRange(0,100)); slTreble.setRotationIncrement (10); slTreble.setTickSpacing (1); slTreble.setText (reslib.loadString(STR_TREBLE)); addToCell (&slTreble, 4, 1, 1, 1); slPitch.setArmRange (IRange(0,100)); slPitch.setRotationIncrement (10); slPitch.setTickSpacing (1); slPitch.setText (reslib.loadString(STR_PITCH)); addToCell (&slPitch, 5, 1, 1, 1); slGain.setArmRange (IRange(0,100)); slGain.setRotationIncrement (10); slGain.setTickSpacing (1); slGain.setText (reslib.loadString(STR_GAIN)); addToCell (&slGain, 6, 1, 1, 1); addToCell (&name, 3, 2, 3, 1); ampHandler.handleEventsFor(this); IMMAmpMixer* tempAmp = 0; if (pAmpMixer3) tempAmp=pAmpMixer3; else if (pAmpMixer2) tempAmp=pAmpMixer2; else if (pAmpMixer1) tempAmp=pAmpMixer1; if (tempAmp) { slVolume.setValue (tempAmp->volume ()); slBalance.setValue(tempAmp->balance()); slBass.setValue (tempAmp->bass ()); slTreble.setValue (tempAmp->treble ()); slPitch.setValue (tempAmp->pitch ()); slGain.setValue (tempAmp->gain ()); } /* endif */ }
/****************************************************************************** * Class LInfoWindow :: LInfoWindow - Constructor for the information window * * given an employee. * * * * Define yourself as an IFrameWindow * * Create title * * Create notebook * * Create help window * * Store pointer to container object * * Store query flag * ******************************************************************************/ LInfoWindow::LInfoWindow ( unsigned long windowId, IWindow* parent, IWindow* owner, IPoint bottomLeft, LCnrObject* object, LEmployeeData& employee, bool isQuery ) :IFrameWindow ( windowId, parent, owner, IRectangle(), classDefaultStyle | dialogBackground | dialogBorder ), title ( this ), notebook ( this, this, employee, isQuery ), help ( ID_HELP_TABLE3, this ), pObject ( object ), isAQuery ( isQuery ) { /*----------------------------------------------------------------------------- | If this window was launched from a cnr object, | | - set as open | | - increment usage count | -----------------------------------------------------------------------------*/ if ( pObject ) { pObject->setOpen(); pObject->incrementUsage(); } /*----------------------------------------------------------------------------- | Attempt to load the help file | -----------------------------------------------------------------------------*/ try { help.addLibraries( "lanchelp.hlp" ); help.setTitle( STR_HELP_TITLE ); } catch( ... ) {} /*----------------------------------------------------------------------------- | Handle command events for this frame window | -----------------------------------------------------------------------------*/ ICommandHandler::handleEventsFor( this ); /*----------------------------------------------------------------------------- | Determine the title for this frame window | -----------------------------------------------------------------------------*/ if ( isQuery ) title.setTitleText( STR_MAIN_TITLE, STR_QUERY_INFO_WINDOW ); else if ( ! employee.employeeNumber().length() ) title.setTitleText( STR_MAIN_TITLE, STR_NEW_INFO_WINDOW ); else title.setTitleText( IApplication::current().userResourceLibrary(). loadString( STR_MAIN_TITLE ), IString( employee.lastName() + ", " + employee.firstName() ) ); /*----------------------------------------------------------------------------- | Set the frame's icon | | Set the frame's client to be the notebook | -----------------------------------------------------------------------------*/ setIcon( ID_ICON_PERSON4 ); setClient( ¬ebook ); /*----------------------------------------------------------------------------- | Resize the window based on the minimum size of the notebook | -----------------------------------------------------------------------------*/ moveSizeToClient( IRectangle( bottomLeft, notebook.minimumSize() ) ); /*----------------------------------------------------------------------------- | Move the frame window to the best location for the display size | | Set the focus to the frame | | Show the frame | -----------------------------------------------------------------------------*/ IPoint newLocation( LFrameWindow::bestFit( this ) ); moveTo( newLocation ); if ( ( ! newLocation.x() ) || ( !newLocation.y() ) ) maximize(); setFocus().show(); }
/****************************************************************************** * Class LInfoWindow :: LInfoWindow - Constructor for the information window * * given a query string. * * * * Define yourself as an IFrameWindow * * Create title * * Create notebook * * Create help window * * Store pointer to container object * * Store query flag * ******************************************************************************/ LInfoWindow::LInfoWindow ( unsigned long windowId, IWindow* parent, IWindow* owner, IPoint bottomLeft, LMainCnr* cnr, LCnrObject* object, IString queryName ) :IFrameWindow ( windowId, parent, owner, IRectangle(), classDefaultStyle | dialogBackground | dialogBorder ), title ( this ), notebook ( this, this, cnr, queryName ), help ( ID_HELP_TABLE3, this ), pObject ( object ), isAQuery ( true ) { /*----------------------------------------------------------------------------- | If this window was launched from a valid cnr object, | | - set as open | | - increment usage count | -----------------------------------------------------------------------------*/ if ( pObject ) { pObject->setOpen(); pObject->incrementUsage(); } /*----------------------------------------------------------------------------- | Attempt to load the help file | -----------------------------------------------------------------------------*/ try { help.addLibraries( "lanchelp.hlp" ); help.setTitle( STR_HELP_TITLE ); } catch( ... ) {} /*----------------------------------------------------------------------------- | Handle command events for this frame window | -----------------------------------------------------------------------------*/ ICommandHandler::handleEventsFor( this ); /*----------------------------------------------------------------------------- | Set the title of this frame window to indicate a query | -----------------------------------------------------------------------------*/ title.setTitleText( STR_MAIN_TITLE, STR_QUERY_INFO_WINDOW ); /*----------------------------------------------------------------------------- | Set the frame's icon | | Set the frame's client to be the notebook | -----------------------------------------------------------------------------*/ setIcon( ID_ICON_PERSON4 ); setClient( ¬ebook ); /*----------------------------------------------------------------------------- | Resize the window based on the minimum size of the notebook | -----------------------------------------------------------------------------*/ moveSizeToClient( IRectangle( bottomLeft, notebook.minimumSize() ) ); /*----------------------------------------------------------------------------- | Move the frame window to the best location for the display size | | Set the focus to the frame | | Show the frame | -----------------------------------------------------------------------------*/ IPoint newLocation( LFrameWindow::bestFit( this ) ); moveTo( newLocation ); if ( ( !newLocation.x() ) || ( ! newLocation.y() ) ) maximize(); setFocus().show(); }
//************************************************************************** // 1 2 3 * // Col-> 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 * // Row * // 1 * // 2 Hr Min * // 3 Start time: ��Ŀ ��Ŀ * // 4 � � :� � * // 5 ���� ���� * // 6 * // 7 End time: ��Ŀ ��Ŀ * // 8 � � :� � * // 9 ���� ���� * // 10 * // 1 Phone: ��������������������������������������������Ŀ * // 2 � � * // 3 ���������������������������������������������� * // 4 * // 5 Location: ��������������������������������������������Ŀ * // 6 � � * // 7 ���������������������������������������������� * // 8 * // 9 Subject: ��������������������������������������������Ŀ * // 20 � � * // 1 � � * // 2 � � * // 3 � � * // 4 � � * // 5 ���������������������������������������������� * // 6 * // 7 For user: ��������������������������������������������Ŀ * // 8 � � * // 9 � � * // 30 � � * // 1 � � * // 2 � � * // 3 ���������������������������������������������� * // 4 * // 5 ������������Ŀ ������������Ŀ * // 6 � � � � * // 7 �������������� �������������� * //************************************************************************** // ApptDialog :: ApptDialog - add a new meeting * //************************************************************************** ApptDialog :: ApptDialog(Appointment *appt, IWindow * ownerWnd) : IFrameWindow(WND_APPTDIALOG, desktopWindow(), // parent ownerWnd, // owner IRectangle(475, // width 500), // height IWindow::synchPaint |IWindow::clipSiblings |IWindow::saveBits |systemMenu |titleBar |dialogBorder |dialogBackground, "Create an Appointment" ), clientCanvas(WND_CANVAS_APPTDIALOG,this,this), buttons(WND_CANVAS_APPTDIALOGBTN,this,this), txtStarthr(TXT_STARTHR,&clientCanvas,&clientCanvas), txtStophr(TXT_STOPHR,&clientCanvas,&clientCanvas), txtStartsep(TXT_STARTSEP,&clientCanvas,&clientCanvas), txtStopsep(TXT_STOPSEP,&clientCanvas,&clientCanvas), txtLoc(TXT_LOC,&clientCanvas,&clientCanvas), txtSubj(TXT_SUBJ,&clientCanvas,&clientCanvas), txtPhone(TXT_PHONE,&clientCanvas,&clientCanvas), txtUsers(TXT_USERS,&clientCanvas,&clientCanvas), fldStarthr(FLD_STARTHR,&clientCanvas,&clientCanvas), fldStophr(FLD_STOPHR,&clientCanvas,&clientCanvas), fldStartmin(FLD_STARTMIN,&clientCanvas,&clientCanvas), fldStopmin(FLD_STOPMIN,&clientCanvas,&clientCanvas), fldLoc(FLD_LOC,&clientCanvas,&clientCanvas), fldPhone(FLD_PHONE,&clientCanvas,&clientCanvas), mleSubj(FLD_SUBJ,&clientCanvas,&clientCanvas), lboxUsers(LB_USERS,&clientCanvas,&clientCanvas), btnOk(DID_OK,&buttons,&buttons), btnCancel(DID_CANCEL,&buttons,&buttons) { ITime ctime; apptObject=(Appointment *)appt; if (appt->somIsA(_Meeting)) apptType = MEETING; else apptType = CCALL; setClient(&clientCanvas); ICommandHandler::handleEventsFor(this); // Set self as command event handler fldStarthr.setInputType(ISpinButton::numeric) .setLimit(2UL) .setAlignment(ISpinButton::right) .setRange(IRange(0,23)) .setCurrent((long)ctime.hours()); fldStartmin.setInputType(ISpinButton::numeric) .setLimit(2UL) .setAlignment(ISpinButton::right) .setRange(IRange(0,59)) .setCurrent((long)ctime.minutes()); fldStophr.setInputType(ISpinButton::numeric) .setLimit(2UL) .setAlignment(ISpinButton::right) .setRange(IRange(0,23)) .setCurrent((long)ctime.hours()); fldStopmin.setInputType(ISpinButton::numeric) .setLimit(2UL) .setAlignment(ISpinButton::right) .setRange(IRange(0,59)) .setCurrent((long)ctime.minutes()); txtStarthr.setText(STR_START); txtStophr.setText(STR_STOP); txtStartsep.setText(":"); txtStopsep.setText(":"); if (apptType == CCALL) txtPhone.setText(STR_PHONE); else txtLoc.setText(STR_LOCATION); txtSubj.setText(STR_SUBJECT); txtUsers.setText(STR_USERS); btnOk.setText(STR_OK); btnCancel.setText(STR_CANCEL); // Field Col Row #Col #Row clientCanvas.addToCell(&txtStarthr , 1, 3, 6, 1); clientCanvas.addToCell(&txtStophr , 1, 7, 6, 1); if (apptType == CCALL) clientCanvas.addToCell(&txtPhone , 1, 11, 6, 1); else clientCanvas.addToCell(&txtLoc , 1, 11, 6, 1); clientCanvas.addToCell(&txtSubj , 1, 15, 6, 1); clientCanvas.addToCell(&txtUsers , 1, 24, 6, 1); clientCanvas.addToCell(&fldStarthr , 7, 3, 2, 1); clientCanvas.addToCell(&fldStartmin , 11, 3, 2, 1); clientCanvas.addToCell(&fldStophr , 7, 7, 2, 1); clientCanvas.addToCell(&fldStopmin , 11, 7, 2, 1); if (apptType == CCALL) clientCanvas.addToCell(&fldPhone , 7, 11, 22, 2); else clientCanvas.addToCell(&fldLoc , 7, 11, 22, 2); clientCanvas.addToCell(&mleSubj , 7, 15, 22, 7); clientCanvas.addToCell(&lboxUsers , 7, 24, 22, 7); setFocus(); buttons.setMargin(ISize()); // Set Canvas Margins to zero buttons.setPad(ISize()); // Set Button Canvas Pad to zero addExtension(&buttons, IFrameWindow::belowClient, (unsigned long)buttons.minimumSize().height()+10); fldStarthr.setFocus(); }
const IRectangle strgen::defaultFramingSpec() { return(IRectangle(IPoint(30, IWindow::desktopWindow()->size().height() - 30 - 384),ISize(512, 384))); }
IRectangle FastCanvas::defaultFramingSpec() { return(IRectangle(IPoint(30,109),ISize(400, 300))); }
void P_Crop::showExtraControls() { if( xStartTxt == 0 ) { // create all of the necessary controls xStartTxt = new IStaticText( P_CROP_XSTART_TXT, this, this, IRectangle(), (IStaticText::classDefaultStyle | IStaticText::bottom | IControl::group) & ~IStaticText::top ); xStartSB = new INumericSpinButton( P_CROP_XSTART_SB, this, this, IRectangle(), INumericSpinButton::classDefaultStyle | INumericSpinButton::fastSpin | IControl::tabStop ); xEndTxt = new IStaticText( P_CROP_XEND_TXT, this, this, IRectangle(), (IStaticText::classDefaultStyle | IStaticText::bottom) & ~IStaticText::top ); xEndSB = new INumericSpinButton( P_CROP_XEND_SB, this, this, IRectangle(), INumericSpinButton::classDefaultStyle | INumericSpinButton::fastSpin | IControl::tabStop ); yStartTxt = new IStaticText( P_CROP_YSTART_TXT, this, this, IRectangle(), (IStaticText::classDefaultStyle | IStaticText::bottom | IControl::group) & ~IStaticText::top ); yStartSB = new INumericSpinButton( P_CROP_YSTART_SB, this, this, IRectangle(), INumericSpinButton::classDefaultStyle | INumericSpinButton::fastSpin | IControl::tabStop ); yEndTxt = new IStaticText( P_CROP_YEND_TXT, this, this, IRectangle(), (IStaticText::classDefaultStyle | IStaticText::bottom) & ~IStaticText::top ); yEndSB = new INumericSpinButton( P_CROP_YEND_SB, this, this, IRectangle(), INumericSpinButton::classDefaultStyle | INumericSpinButton::fastSpin | IControl::tabStop ); IMenuHandler::handleEventsFor( xStartTxt ); IMenuHandler::handleEventsFor( yStartTxt ); IMenuHandler::handleEventsFor( xEndTxt ); IMenuHandler::handleEventsFor( yEndTxt ); IFocusHandler::handleEventsFor( xStartSB ); IFocusHandler::handleEventsFor( yStartSB ); IFocusHandler::handleEventsFor( xEndSB ); IFocusHandler::handleEventsFor( yEndSB ); // set the initial crop size to cover the entire image P_Size *p_size = ((POV_LaunchDialog*)(owner()->owner()))->PSize; checkSize(); xStartSB-> spinTo( 1 ).setLimit( 5 ); yStartSB-> spinTo( 1 ).setLimit( 5 ); xEndSB-> spinTo( p_size->width ).setLimit( 5 ); yEndSB-> spinTo( p_size->height ).setLimit( 5 ); // set the text prompt xStartTxt-> setText( "start X" ); yStartTxt-> setText( "start Y" ); xEndTxt-> setText( "end X" ); yEndTxt-> setText( "end Y" ); } return; }
/****************************************************************************** * Class AccountPage :: fillCnr - Set up the container * ******************************************************************************/ AccountPage& AccountPage::fillCnr() { /*----------------------------------------------------------------------------- | If the container already exists, | | delete all the objects | | Else create a new container. | -----------------------------------------------------------------------------*/ if ( pCnr ) pCnr->deleteAllObjects(); else { pCnr = new IContainerControl( ID_ACC_CNR, this, this, IRectangle(), IContainerControl::classDefaultStyle | IContainerControl::readOnly | IContainerControl::pmCompatible, IContainerControl::readOnlyTitle | IContainerControl::detailsView ); /*----------------------------------------------------------------------------- | Handle selection events for the new container. | -----------------------------------------------------------------------------*/ cnrSelHandler.handleEventsFor( pCnr ); /*----------------------------------------------------------------------------- | Delete the objects when the container is deleted. | | Tell the container to allow multiple selection. | | Tell the container to automatically refresh upon changes. | -----------------------------------------------------------------------------*/ pCnr->setDeleteObjectsOnClose(); pCnr->setDeleteColumnsOnClose(); pCnr->setMultipleSelection(); pCnr->setRefreshOn(); /*----------------------------------------------------------------------------- | Create two container columns. | -----------------------------------------------------------------------------*/ pColUserID = new IContainerColumn( pAcctCnrObj->currentUserIdOffset(), IContainerColumn::defaultHeadingStyle(), IContainerColumn::string ); pColNodeSys = new IContainerColumn( pAcctCnrObj->nodeSysOffset(), IContainerColumn::defaultHeadingStyle(), IContainerColumn::string ); /*----------------------------------------------------------------------------- | Label the container column headings. | | Show the headings. | | Show the headings. | -----------------------------------------------------------------------------*/ pColUserID->setHeadingText( STR_ACC_USERID ); pColNodeSys->setHeadingText( STR_ACC_NODESYS ); pCnr->showDetailsViewTitles(); /*----------------------------------------------------------------------------- | Add the columns to the container. | | Add column separators between the columns. | -----------------------------------------------------------------------------*/ pCnr->addColumn( pColUserID ); pCnr->addColumn( pColNodeSys ); pColUserID->showSeparators( IContainerColumn::verticalSeparator | IContainerColumn::horizontalSeparator ); pColNodeSys->showSeparators( IContainerColumn::horizontalSeparator ); } /*----------------------------------------------------------------------------- | Start from the beginning of the account data. | | While there exists items, | | add objects to the container. | | Refresh the container. | | Return yourself. | -----------------------------------------------------------------------------*/ IString user, node; LAcctData::Rule rule; acctData.setFirst(); while ( acctData.getItem( user, node, rule ) ) { addAcct( user, node ); acctData.getNext(); } pCnr->refresh(); return *this; };