Virtual Keyboard for TextEditor

Discuss GUI programming with the MUI Royale plugin here
Post Reply
seventhwonder
Posts: 7
Joined: Wed Jul 18, 2018 3:11 pm

Virtual Keyboard for TextEditor

Post by seventhwonder »

Hi

I am trying to code virtual keyboard for a texteditor gadget in MUI.Royale
How can I append the virtual key values to texteditor

This code only changes the content, is it possible to append ?

Code: Select all

unction p_EventFunc(msg)

	Switch msg.action
	Case "MUIRoyale":
		Switch msg.attribute
		Case "CloseRequest":
			End
		Case "Active":
			Switch msg.id
			Case "radio":
				mui.Set("men_hw" .. msg.triggervalue + 1, "selected", True)
			Default:
				mui.Set(msg.muiuserdata, "disabled", Not msg.triggervalue)
			EndSwitch
		Case "Selected":
			Switch msg.id
			Case "men_about":
				MUI.Request("Menus", "Some little about window.", "OK")
			Case "men_quit":
				End
			
			EndSwitch
		Case "Pressed":
			Switch msg.id
			Case "1":
mui.set("editor", "contents", "1")
			EndSwitch
 		EndSwitch

	case "HideWindow":
		mui.Set("app", "iconified", True)

	case "ShowWindow":
		mui.Set("app", "iconified", False)
	EndSwitch

EndFunction
GUI XML is:

Code: Select all

<hgroup frame="group" frametitle="">
				<texteditor id="editor" scrollbar="true" cyclechain="1" notify="areamarked; undoavailable; stylebold; styleitalic; styleunderline; color; align"
notifydata="stylebold: tb_bold; styleitalic: tb_italic; styleunderline: tb_underline"/>
</hgroup>

<hgroup frame="group" frametitle="">
				<button id="1" notify="pressed">_1</button>
				<button id="2" notify="pressed">_2</button>
				<button id="3" notify="pressed">_3</button>
				<button id="4" notify="pressed">_4</button>
				<button id="5" notify="pressed">_5</button>
				<button id="6" notify="pressed">_6</button>
				<button id="7" notify="pressed">_7</button>
				<button id="8" notify="pressed">_8</button>
				<button id="9" notify="pressed">_9</button>
				<button id="0" notify="pressed">_0</button>
				<button id="*" notify="pressed">_*</button>
				<button id="-" notify="pressed">_-</button>

			</hgroup>

User avatar
jPV
Posts: 395
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Virtual Keyboard for TextEditor

Post by jPV »

Texteditor.Insert?

Something like this?

Code: Select all

		Case "Pressed":
			mui.DoMethod("editor", "Insert", msg.id, "Cursor")
 		EndSwitch

Post Reply