Getting a reference to the window’s menu is easily accomplished using the window’s MenuId property. But what if you want to get a reference to a submenu and all you have is a string with the menu’s name? This following function will do the trick: Continue reading →
August 1, 2009
Posted by rick130 |
1. PowerBuilder General, Menus, Powerscript | menu, powerscript, submenu |
1 Comment
1) Create the following user event in your application’s frame window
Continue reading →
May 6, 2008
Posted by rick130 |
Menus, Powerscript, Window Controls | ancestor, doubleparm, frame, menu, message, of_sendmessage, open, opensheet, opensheetwithparm, stringparm, window |
Leave a comment
Aron wanted a datawindow to be able have all the standard windows shortcut key “<cntl> A” for “Select All”. He was using the PFC multi row select, so he was able to give the standard <Cntl> and <Shift> extended selection.
His solution was to use a hidden menu where the Select All menu item is triggered by the shortcut key “<Cntl> A”. This problem was complicated by the fact that the window was a Response window, and needed to have the menu assignment done dynamically. Here is the code he put in the PreOpen Event.
menu lm
// m_response_edit is menu inherited from m_frame
int i
// In order to make keyboard shortcuts available, create a hidden menu
If Not IsValid(This.menuId) Then
// Instantiate the menu
This.ChangeMenu(m_response_edit)
lm = This.menuId
// Hide the menu and it's first level items
lm.visible = False
For i = 1 To UpperBound(lm.item)
lm.item[i].visible = False
Next
End if
May 6, 2008
Posted by rick130 |
Menus | a, alt, cut, keys, menu, short |
1 Comment
Add a menu item under FUNCTIONS which exports a datawindow to excel. This example assumes PFC is being used.
Add the item Functions > Export to Excel
Script
of_SendMessage(‘ue_export’)
Properties:
Enabled = FALSE
Your main sheet ancestor
Protected:
u_dw idw_export
//////////////////////////////////////////////////////////////////////////////
// Event: w_sheet_lm:ue_export
//
// Description: export the registered datawindow (idw_export) to excel
//
//////////////////////////////////////////////////////////////////////////////
if IsValid(idw_export) then
. idw_export.SaveAs(“”, Excel5!, TRUE)
end if
- In the Activate Event of the sheet, enable the menu item EXPORT
- In the Deactivate Event of the sheet, disable the menu item EXPORT
- In the window pfc_preopen event, associate the datawindow you wish to export to idw_export
- If you want to do something trickier, for example, you want to allow the user to select one of several different datawindows to export, override the sheet’s UE_EXPORT event.
April 15, 2008
Posted by rick130 |
Menus | excel, export, menu |
Leave a comment
- Right click the menu bar
- Select “Customize … “ from the popup menu
- Select the “Custom” radio button
- Drag an icon from the array of icons available and position it on the toolbar
- The command line should read
winhlp32.exe C:\PWRS6\PB6\Help\pbpfc60.hlp
winhlp32.exe C:\Program Files\Sybase\PowerBuilder 7.0\Help\pbpfc70.hlp
- Enter toolbar text and a tooltip Miscellaneous PowerBuilder Stuff
boolean lb_visible
integer li_toolbarindex
string ls_title
ToolbarAlignment ltb_alignment
this.GetToolbar(li_toolbarindex, lb_visible, ltb_alignment, ls_title)
Several toolbar properties are set in the application object
iapp_object.ToolbarSheetTitle = “Sheet toolbar”
iapp_object.ToolbarFrameTitle = “Frame toolbar”
this.ToolBarVisible = False
Continue reading →
April 9, 2008
Posted by rick130 |
Menus | Help, menu, PFC help, Toolbar |
1 Comment