MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Pop-Up Menu In PowerBuilder

Published on 02 November 17
708
0
1
You may find popup menus in PowerBuilder for Save,Insert,Delete operations on Datawindows while right clicking on them.

>> Create a menu with Update,Insert,Delete,etc., Menu Items
EX: For Insert Menuitem
//Insert:: Clicked Event
idw_datawindow.event dynamic ue_insert()

// in the menupainter --> View --> Variables --> Instance Variables

//protected:
datawindow idw_datawindow
>> Write the code in same way for the other menu items
>> Create a user object of type datawindow
>> Save it as ue_popupmenu
// UserObject:: Constructor
//Presuming that you have transaction object setup for this
this.settransobject( SQLCA)
this.retrieve()
// UserObject:: Create new event ue_insert() and write the below code under that

int li_i
li_i=this.insertrow(0)
this.scrolltorow( li_i)
if li_i<0 then
MessageBox("Error - Insert","Error is ~n"+SQLCa.sqlerrtext)
end if
// UserObject:: In the same way write code for update,delete or any other events based on your requirement

// Now in the rbuttondown event write the below code which opens the popup-menu
// UserObject::rbuttondown
m_popup lm_popup
lm_popup=create m_popup
lm_popup.idw_datawindow=this
lm_popup.popmenu( this.pointerx( )+10,this.pointery( )+10)
>>Now in your application, inherit your datawindow from ue_popupmenu
>> Run the application, Right Click on the Datawindow

Pop-Up Menu In PowerBuilder - Image 1
Pop-Up Menu In PowerBuilder - Image 2
You may find popup menus in PowerBuilder for Save,Insert,Delete operations on Datawindows while right clicking on them.

>> Create a menu with Update,Insert,Delete,etc., Menu Items

EX: For Insert Menuitem

//Insert:: Clicked Event

idw_datawindow.event dynamic ue_insert()

// in the menupainter --> View --> Variables --> Instance Variables

//protected:

datawindow idw_datawindow

>> Write the code in same way for the other menu items>> Create a user object of type datawindow

>> Save it as ue_popupmenu

// UserObject:: Constructor//Presuming that you have transaction object setup for this
this.settransobject( SQLCA)

this.retrieve()

// UserObject:: Create new event ue_insert() and write the below code under that

int li_i

li_i=this.insertrow(0)

this.scrolltorow( li_i)

if li_i MessageBox("Error - Insert","Error is ~n"+SQLCa.sqlerrtext)

end if

// UserObject:: In the same way write code for update,delete or any other events based on your requirement

// Now in the rbuttondown event write the below code which opens the popup-menu

// UserObject::rbuttondown

m_popup lm_popup

lm_popup=create m_popup

lm_popup.idw_datawindow=this

lm_popup.popmenu( this.pointerx( )+10,this.pointery( )+10)

>>Now in your application, inherit your datawindow from ue_popupmenu>> Run the application, Right Click on the Datawindow

Pop-Up Menu In PowerBuilder - Image 1

Pop-Up Menu In PowerBuilder - Image 2

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top