|
open
|
|
Full name
|
pfc_w_message.open
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event open()
|
Name
|
Datatype
|
li_bmp
|
Integer
|
li_index
|
Integer
|
li_rc
|
Integer
|
llvi_item
|
ListViewItem
|
event open;//////////////////////////////////////////////////////////////////////////////
//
// Event: open
//
// (Arguments: None)
//
// (Returns: None)
//
// Description: Open the window with the appropriate information.
// Call the function to Size and Move controls around to
// match the window information.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 5.0.02 Move Picture Icon to left past the window border.
// 5.0.03 Code formerly in pfc_preopen event
// 5.0.04 Correct Tab Order and added focus to default button.
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_rc
Integer li_index
Integer li_bmp
ListViewItem llvi_item
//Get the PowerObjectParm.
inv_errorattrib = Message.powerobjectparm
// Allow window to close without the CloseQuery checks being performed.
ib_disableclosequery = True
// Set the titlebar.
This.title = inv_errorattrib.is_title
// Set the Message MLE.
mle_message.Text = inv_errorattrib.is_text
// As requested, set the Picture Icon.
Choose Case inv_errorattrib.ie_icon
Case information!
li_bmp = 1
Case stopsign!
li_bmp = 2
Case exclamation!
li_bmp = 3
Case question!
li_bmp = 4
Case Else
li_bmp = 0
End Choose
If li_bmp > 0 Then
lv_bmp.X = lv_bmp.X - 30
llvi_item.PictureIndex = li_bmp
li_Index = lv_bmp.AddItem(llvi_item)
lv_bmp.SetItem(1, llvi_item)
llvi_item.ItemX = -100
llvi_item.ItemY = 5
Else
lv_bmp.Visible = False
End If
// As requested, Enable/Disable Print.
cb_print.enabled = inv_errorattrib.ib_print
cb_print.visible = inv_errorattrib.ib_print
// As requested, Enable/Disable User input.
cb_userinput.enabled = inv_errorattrib.ib_userinput
cb_userinput.visible = inv_errorattrib.ib_userinput
// As requested, set the timer.
If inv_errorattrib.ii_timeout > 0 Then
// Automatically close this response window after ii_timeout seconds.
timer(inv_errorattrib.ii_timeout)
End If
// As requested, display/enable the appropriate button(s).
Choose Case inv_errorattrib.ie_buttonstyle
Case ok!
//-- An (OK) button has been requested. --
// Set the text attribute(s).
cb_1.Text = "OK"
// Set the default attribute(s).
cb_1.Default = True
cb_1.SetFocus()
// Make button(s) visible or invisible.
cb_1.Visible = True
cb_2.Visible = False
cb_3.Visible = False
Case okcancel!, yesno!, retrycancel!
//-- An (OK and Cancel) or (Yes and No) or (Retry and Cancel) --
//-- buttons have been requested. --
// Set the text attribute(s).
If inv_errorattrib.ie_buttonstyle = okcancel! Then
// An OK and Cancel buttons have been requested.
cb_1.Text = "OK"
cb_2.Text = "Cancel"
ElseIf inv_errorattrib.ie_buttonstyle = yesno! Then
// A Yes and No buttons have been requested.
cb_1.Text = "&Yes"
cb_2.Text = "&No"
Else
// A Retry and Cancel buttons have been requested.
cb_1.Text = "Retry"
cb_2.Text = "Cancel"
End If
// Set the default attribute(s).
If inv_errorattrib.ii_default = 2 Then
cb_2.default = True
cb_2.SetFocus()
Else
// Default value.
cb_1.default = True
cb_1.SetFocus()
End If
// Make button(s) visible or invisible.
cb_1.visible = True
cb_2.visible = True
cb_3.Visible = False
Case yesnocancel!, abortretryignore!
//-- A (Yes, No, and Cancel) or (Abort, Retry, and Ignore) --
//-- buttons have been requested. --
// Set the text attribute(s).
If inv_errorattrib.ie_buttonstyle = yesnocancel! Then
// A Yes, No, and Cancel buttons have been requested.
cb_1.Text = "&Yes"
cb_2.Text = "&No"
cb_3.Text = "Cancel"
Else
// An Abort, Retry, and Ignore buttons have been requested.
cb_1.Text = "Abort"
cb_2.Text = "Retry"
cb_3.Text = "Ignore"
End If
// Set the default attribute(s).
If inv_errorattrib.ii_default = 3 Then
cb_3.default = True
cb_3.SetFocus()
ElseIf inv_errorattrib.ii_default = 2 Then
cb_2.default = True
cb_2.SetFocus()
Else
// Default value.
cb_1.default = True
cb_1.SetFocus()
End If
// Make button(s) visible or invisible.
cb_1.visible = True
cb_2.visible = True
cb_3.visible = True
End Choose
// Size and Move controls around to match the window information.
li_rc = of_PaintInitialWindow()
end event
Name
|
Owner
|
dragobject.setfocus |
dragobject
|
listview.additem |
listview
|
listview.setitem |
listview
|
systemfunctions.timer |
systemfunctions
|
pfc_w_message.of_paintinitialwindow |
pfc_w_message
|