onscreen keyboard for DDgui

Previous topic - Next topic

Kitty Hello

Hi,

it's time for me to ask a question now ;)

Anyone, who played with DDgui, I improved speed a lot and it's running nicely on a PocketPC now. The problem is - input.
So, I made a DDguiDialog that can edit a text:



The editor is 240x240, perfect fr PocketPC and GP2X/WIZ.
The question now is - how to implement this dialog within the DDgui module, so you can edit any DDGui_text's contents by "clicking" it - or so...
Is my question clear?
How to open the dialog, and where to click to do it?

Thank you.




trucidare

ON_EVENT(click)
   IF txt_box <> readonly
      OSK_Show(txt_box)
   ENDIF
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

readonly - interessanting idea.

Moru

Agh, don't tell me I need to redo the proportional font implementation...ahwell it wasn't working perfectly with edit boxes anyway...

Kitty Hello

Was not? :D
I will have a look and implement it optionally, OK?

Kitty Hello



It's working great, and I got the kerning in the whole DDgui, now (Just one function you call to create a kerning width table).
I will have to work on it, because switching from abc to ABC takes quite a while on the PocketPC.
Typing is reasonably fast, so no problems here.
I introduces the READONLY flag for a text, and auto-DDGui_input$'ed editable texts for GP2X and PocketPC.

I know very few have used DDgui so far, but it's one of my most useful projects, ever. I really encourage you to try it, if you need any sort of GUI within a window.

V6 will probably feature a native-skinned GUI with Tcl/Tk, but this is a LOT of overhead for small projects. Also, DDgui is much easier to use. It's much more "GLBasic" than native GUIs, because it's not requiring any "callback" or "messaging" functionality.




Moru

It's realy nice to use with proportional spacing, easy to make options for your programs. I'm using it for some simple dialogs with input in Scribble.

But there is some need for some more documentation I think. Specific examples for each function, not a finnished program. This is how you get a text string, what the parameters are for and so on, needed some trial and error to get that working.

Kitty Hello

Really!?
What part was hard to understand? I thought the documentation at the top of the file is extensive.

MrTAToad

Would it be possible to add the ability for text boxes to accept up to X number of characters - I need that for my game :)

If possible, a bit more control over where entities could go would be nice too - as I mentioned previously, it would have been nice to be able to put in buttons vertically to the right of a list box. 

A window with a title, but unable to move would be handy too


Hemlos

#9
Quote from: MrTAToad on 2008-Oct-16
Would it be possible to add the ability for text boxes to accept up to X number of characters - I need that for my game :)


Funny you should ask, i made this function about a week ago...i use it for all my text input$ lately.
Its a goal oriented inkey$(), to limit size of input, and pass data, when enter is pressed.
It works similiar to the good old BASIC input$, with a twist...It limits the length of the input.

Maybe you can incorporate this function, into DDGui?


If you need a window with it..just use drawrects?
Code (main body) Select

Print "Write Name(MAX: 10 characters): "+HText$,10,10
if Hemlos_INPUT$(HText$,10) //if enter pressed
   NewMsg$=HText$ //pass data
   HText$="" //clear input
endif
Print "Your Name is: "+NewMsg$,10,30




Code (function) Select

FUNCTION Hemlos_INPUT$: BYREF HText$, SizeLimiter
//Limit size LEN(HText$) of input=SizeLimiter
// if return = false then Enter not pressed yet
// if return = true then Enter Pressed
LOCAL InText$
InText$=INKEY$()
IF LEN(HText$)>SizeLimiter THEN InText$="\b" //limit the length of input, auto backspace
SELECT InText$ //read the input
CASE "\n" //enter is pressed
IF SizeLimiter>0
IF LEN(HText$)=0 THEN RETURN FALSE
ENDIF
RETURN TRUE // good - finished, send goal
CASE "\b" //backspaced
HText$=MID$(HText$,0,LEN(HText$)-1)
RETURN FALSE
DEFAULT //character added to input byref
HText$=HText$+InText$
RETURN FALSE
ENDSELECT
ENDFUNCTION


Perhaps you can change it too or add another function to go with it to scroll if the limit is reached allowing for long inputs with only sizelimit characters showing :)
This way you can fit it in a presized "input window", like the way you can input a URL into a web browser where it scrolls off to the right, you can do this with mid$

Bing ChatGpt is pretty smart :O

Moru

DDGui already does the scrolling and so on, all you need to do is limit the number of characters possible to input.

Kitty Hello

Yes, next version of DDgui is a complete renewal. Much faster and better to debug.
It includes the above keyboard, for PocketPC/GP2X. Very useful.
Also, tooltips.