Notes for week 4

For this week's links click here.

Discussion of The Final Project Interface

Tuesday each group will bring a complete description (with drawings (can be hand drawn or screen dumps)) of the interface you will use in your final project. Each group will present this interface to the class with reasons for each choice. The class will write final specifications for the final project after viewing the interface designs. Every group will meet the specifications decided at this time.

Using a Right Button in a ListBox

Create a RightButtonListBox

One way we can improve our interface is to reduce the amount of mouse motion necessary to perform an operation. In a typical operation in our course program we select an item in one of the windows, them move the mouse to the menu bar to select an operation. If we allowed the use to select and display the menu by a click of the right button, we would save time and motion. We will implement the right-button select as described in the Borland notes.

Creating a Popup Menu

Once you have a right button list box, you want to have the parent respond to the right-button click. In this case we display a menu and enable choice of operations from that menu. This is covered in the Borland notes.

Applying This Technique in Our Example

Now that we have the boiler plate code complete we need only look at the constructor and SetupWindow function (if it exists) for our professor window to see where the listbox was created. In this case we have two constructors where we replace TListBox with RButtonListBox.

ProfWindow::ProfWindow (TWindow* parent, TResId resId, TModule* module):
    TDialog(parent, resId, module)
{
//{{ProfWindowXFER_USE}}
     _professors = new RButtonListBox(this, IDC_PROFESSORS);

     SetTransferBuffer(&ProfWindowData);
//{{ProfWindowXFER_USE_END}}

    // INSERT>> Your constructor code here.

}


ProfWindow::ProfWindow (ProfListPtr profs,TWindow* parent, TResId resId, TModule* module):
     TDialog(parent, resId, module),_profList(profs)
{
//{{ProfWindowXFER_USE}}
     _professors = new RButtonListBox(this, IDC_PROFESSORS);


     SetTransferBuffer(&ProfWindowData);
//{{ProfWindowXFER_USE_END}}

    // INSERT>> Your constructor code here.

}

Now a right button click inside the professor window displays and activates a popup menu.

Complete Project

Click here to get the complete project.