Kevin Donaher-Ring, a fellow Alpha newbie, posted "Choosing attributes for a record" recently on the forum, to which Tom Cone, Jr. responded with a script to do so. Thank you Tom!
I have extended Tom's example in the attached zip file with form, tables, and action scripts.
Generically, Kevin's problem was assigned sports interests to students. A check list is a handy way of doing so.
The only trick about this is to remember to require unique records for tblStudentInterest. You can do so, by clickon on the lookup tab for Interest in that table and specify an expression of "Student_Id+Interest" for the unique test.
Screen 1
Shows the Default XDialog form that is generated. Ugh, not very professional. Note that Alpha can not generate a form with even margins to save their collective lives! The top, bottom, left, and right margins are all different. Sloppy, sloppy. The line is extraneous if there is no text footer.
Here's a better practice design hint: when buttons are placed at the top the dialog box, they should be left aligned, when placed at the bottom, they should be right aligned.
Screen 2
Shows the result of my surgery to the XDialog code. This was my first time using XDialog and I didn't like it, not one little bit. I remember several months ago making a comment on this forum, that XDialog reminded me of an old mainframe graphics package called Tell-A-Graph, that required laborious coding then executing the code repeatedly to get the appearance of a graph correct. This experience only confirmed that preliminary assessment. In my opinion, XDialog is no way to design a form. I spent over 6 hours, starting from ground zero, working on these simple changes. I was forced to use XDialog only because Alpha does not offer a CheckBox ListBox as a desktop control.
Screen 3 and Screen 4
Shows what professionally designed dialog screeens (MS Outlook) look like to do exactly the same thing. Notice the care and attention given to the placement of buttons and list boxes. All I can say is that I'm glad Alpha doesn't also run an auto body shop. Slam Microsoft all you want, but they are reasonably attentive to good visual design.
Here's the XDialog code that I gave me the result I sought: simple, clean, and without the appearance of having been thrown together. I converted the Action Script that Alpha generated into In-line XBasic. A useful learning exercise may be comparing my code with that of the default.
Bob McGaffic
Pittsburgh, PA
PS: I have included msgbox in the script that populates the children records to demonstrate what the code is doing. They are easily removed.
I have extended Tom's example in the attached zip file with form, tables, and action scripts.
Generically, Kevin's problem was assigned sports interests to students. A check list is a handy way of doing so.
The only trick about this is to remember to require unique records for tblStudentInterest. You can do so, by clickon on the lookup tab for Interest in that table and specify an expression of "Student_Id+Interest" for the unique test.
Screen 1
Shows the Default XDialog form that is generated. Ugh, not very professional. Note that Alpha can not generate a form with even margins to save their collective lives! The top, bottom, left, and right margins are all different. Sloppy, sloppy. The line is extraneous if there is no text footer.
Here's a better practice design hint: when buttons are placed at the top the dialog box, they should be left aligned, when placed at the bottom, they should be right aligned.
Screen 2
Shows the result of my surgery to the XDialog code. This was my first time using XDialog and I didn't like it, not one little bit. I remember several months ago making a comment on this forum, that XDialog reminded me of an old mainframe graphics package called Tell-A-Graph, that required laborious coding then executing the code repeatedly to get the appearance of a graph correct. This experience only confirmed that preliminary assessment. In my opinion, XDialog is no way to design a form. I spent over 6 hours, starting from ground zero, working on these simple changes. I was forced to use XDialog only because Alpha does not offer a CheckBox ListBox as a desktop control.
Screen 3 and Screen 4
Shows what professionally designed dialog screeens (MS Outlook) look like to do exactly the same thing. Notice the care and attention given to the placement of buttons and list boxes. All I can say is that I'm glad Alpha doesn't also run an auto body shop. Slam Microsoft all you want, but they are reasonably attentive to good visual design.
Here's the XDialog code that I gave me the result I sought: simple, clean, and without the appearance of having been thrown together. I converted the Action Script that Alpha generated into In-line XBasic. A useful learning exercise may be comparing my code with that of the default.
Code:
'Create an XDialog dialog box to prompt for parameters. DIM SHARED mSelectedItems as C DIM SHARED varC_result as C auto_list_mSelectedItems = table.external_record_content_get("tblcategory","Category","Category","") temp_count = w_count(auto_list_mSelectedItems,crlf()) DELETE a_mSelectedItems DIM a_mSelectedItems[temp_count] as c a_mSelectedItems.initialize(auto_list_mSelectedItems) ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Categories ",<<%dlg% {xmargin=1.75,1} {ymargin=1,-1} {region} {xsize=12}{justify=left} <.6",.22"=ok_button_label!OK>|<.6",.22"=cancel_button_label!CANCEL> {endregion}; {region} [.40,35mSelectedItems^$$a_mSelectedItems]; {endregion}; %dlg%)
Pittsburgh, PA
PS: I have included msgbox in the script that populates the children records to demonstrate what the code is doing. They are easily removed.
Comment