- Creating the User Feedback Form
- Sending the Data
- Defining Feedback Form Linkage
- Summary
Now that you have a generic feedback form that accepts multiple types of input, you can use it in many areas of the application. The specific feedback form layout the user sees depends on the requirements of the applicationit's completely flexible. A general feedback form accessed from the menu might require a simple name, title, and comment. On the other hand, an error feedback form might require detailed information about the kind of error so that you can localize it to a specific area. The layout requirement means creating some kind of linkage between the feedback form and the application. Listing 3 shows a typical example of this kind of linkage.
Listing 3 Adding Feedback Form Linkage
private: System::Void mnuHelpFeedback_Click(System::Object * sender, System::EventArgs * e) { UserFeedback *UF; // User feedback form. // Create and display the form. UF = new UserFeedback(); UF->ShowDialog(); } private: System::Void mnuTestHeader_Click(System::Object * sender, System::EventArgs * e) { UserFeedback *UF; // User feedback form. // Create and display the form using a special // title. UF = new UserFeedback("Special Feedback Title"); UF->ShowDialog(); } private: System::Void mnuTestControls_Click(System::Object * sender, System::EventArgs * e) { UserFeedback *UF; // User feedback form. // Create the special control array. String *NewCont[] = new String*[6]; NewCont[0] = "Special Entry"; NewCont[1] = ""; NewCont[2] = "false"; NewCont[3] = "Static Text"; NewCont[4] = "Some Text"; NewCont[5] = "true"; // Create and display the form. UF = new UserFeedback("Feedback with Added Controls", NewCont); UF->ShowDialog(); }
In each case, selecting a menu option makes a request to the user feedback form. In the first case (mnuHelpFeedback_Click), the user sees the standard generic form. In the second case (mnuTestHeader_Click), the user sees a generic form with a specific title. In the third case (mnuTestControls_Click), the user sees a special form with extra controls added. Notice that in the third case you must create a special array that contains the label text, the content of the textbox, and a Boolean value that determines whether the user can edit the information in the textbox. (You wouldn't want a user to edit error information that you'll need to locate and fix an application bug.)