Re: Question about Win32lib's EditText control

new topic     » goto parent     » topic index » view thread      » older message » newer message

George,

Here's a better demo, 'cause after I sent the other, I wan't *sure* it would
work with single line edit, after all!

Dan Moyer

<tested code follows:>

--  code generated by Win32Lib IDE v0.10.5
-- then hand modified

include Win32Lib.ew
without warning

----
--  Window Window1
global constant Window1 = create( Window, "Window1", 0, Default, Default,
400, 300, 0 )
global constant EditText2 = create( EditText, "EditText2", Window1, 20, 36,
256, 40, 0 )

-- 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 )


procedure onClick_MenuUndo()
-- undo
undo(EditText2 )
end procedure
--onClick[ MenuUndo ] = routine_id( "onClick_MenuUndo" )
onClick[ PopUp_Undo ] = routine_id( "onClick_MenuUndo" )


procedure onClick_MenuCut()
-- cut
cut(EditText2 )
--setEnable( MenuUndo, 1 )
end procedure
--onClick[ MenuCut ] = routine_id( "onClick_MenuCut" )
onClick[ PopUp_Cut ] = routine_id( "onClick_MenuCut" )



procedure onClick_MenuCopy()
-- copy
copy(EditText2 )
--setEnable( MenuUndo, 1 )
end procedure
--onClick[ MenuCopy ] = routine_id( "onClick_MenuCopy" )
onClick[ PopUp_Copy ] = routine_id( "onClick_MenuCopy" )



procedure onClick_MenuPaste()
-- paste
paste(EditText2 )
--setEnable( MenuUndo, 1 )
end procedure
--onClick[ MenuPaste ] = routine_id( "onClick_MenuPaste" )
onClick[ PopUp_Paste ] = routine_id( "onClick_MenuPaste" )



procedure onClick_MenuDelete()
-- clear
clear(EditText2 )
--setEnable( MenuUndo, 1 )
end procedure
--onClick[ MenuDelete ] = routine_id( "onClick_MenuDelete" )


-- procedure to respond to right click in edit box:
-- (with the setEnables you can set which are active or not)
procedure onMouse_EditText2( integer event, integer x, integer y, integer
shift )
sequence MousePosition
MousePosition = getMouseRelPos(Window1)-- had usedEditText2
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[EditText2] = routine_id("onMouse_EditText2")





WinMain( Window1, Normal )
----- 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?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu