Re: Question about Win32lib's EditText control
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 03, 2001
- 387 views
George, Thanks for asking, these make good candidates for my "Templates" program! They're not implemented as actual defaults, they have to be created. Drag'n'drop I'm not sure about, but for right-click copy options, do something like this: -- create right click popups: constant EditPopup = create( Popup, "", Window1, 0, 0, 0, 0, 0 ), PopUp_Undo = create( MenuItem, "Undo", EditPopup, 0, 0, 0, 0, 0 ), PopUp_Sep1 = create( MenuItem, "-", EditPopup, 0, 0, 0, 0, 0 ), PopUp_Cut = create( MenuItem, "Cut", EditPopup, 0, 0, 0, 0, 0 ), PopUp_Copy = create( MenuItem, "Copy", EditPopup, 0, 0, 0, 0, 0 ), PopUp_Paste = create( MenuItem, "Paste", EditPopup, 0, 0, 0, 0, 0 ) -- create Edit procedures to respond with: -- (respond to clicks in right-click pop-up, or in regular top menu) - procedure onClick_MenuUndo() -- undo undo( MleText6 ) end procedure onClick[ MenuUndo ] = routine_id( "onClick_MenuUndo" ) onClick[ PopUp_Undo ] = routine_id( "onClick_MenuUndo" ) - procedure onClick_MenuCut() -- cut cut( MleText6 ) setEnable( MenuUndo, 1 ) end procedure onClick[ MenuCut ] = routine_id( "onClick_MenuCut" ) onClick[ PopUp_Cut ] = routine_id( "onClick_MenuCut" ) - procedure onClick_MenuCopy() -- copy copy( MleText6 ) setEnable( MenuUndo, 1 ) end procedure onClick[ MenuCopy ] = routine_id( "onClick_MenuCopy" ) onClick[ PopUp_Copy ] = routine_id( "onClick_MenuCopy" ) - procedure onClick_MenuPaste() -- paste paste( MleText6 ) setEnable( MenuUndo, 1 ) end procedure onClick[ MenuPaste ] = routine_id( "onClick_MenuPaste" ) onClick[ PopUp_Paste ] = routine_id( "onClick_MenuPaste" ) - procedure onClick_MenuDelete() -- clear clear( MleText6 ) setEnable( MenuUndo, 1 ) end procedure onClick[ MenuDelete ] = routine_id( "onClick_MenuDelete" ) -- procedure to respond to right click: -- (with the setEnables you can set which are active or not) procedure onMouse_Mle( integer event, integer x, integer y, integer shift ) sequence MousePosition MousePosition = getMouseRelPos(Window1)-- had used MleText6 if event = RightDown then setEnable( PopUp_Cut, 1 ) setEnable( PopUp_Copy, 1 ) setEnable( PopUp_Paste, 1 ) setEnable( PopUp_Undo, 1 ) popup( EditPopup, MousePosition[1],MousePosition[2] ) end if end procedure onMouse[MleText6] = routine_id("onMouse_Mle") Hope this helps, Dan Moyer ----- Original Message ----- From: "George Papadopoulos" <georgp at otenet.gr> To: "EUforum" <EUforum at topica.com> Sent: Tuesday, October 02, 2001 2:26 PM Subject: Question about Win32lib's EditText control Hi EU-ZE(I)N Why when i right click in an EditText control doesn't appears the default systems's context menu? (Undo..Cut..Copy..etc) Is it a bug? This also happens with Combo but not with ComboEx or MleText control. Is there any way to work Drag n' Drop in a Combo with default style?