Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Windows API: Text Box #271566
06/13/09 23:02
06/13/09 23:02
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
I asked a question a while back about how to make a standard Windows text field, where the user could do everything like copy, paste, cut, highlight text, etc. I never really found the solution I was hunting for. But another question here got me thinking. Someone asked about using the Open/Browse dialog from the Windows API, and was able to get it to work. I did a little research, and text boxes ARE part of Win API. Look here:

http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.aspx

I think there's another type called "Rich Edit Box", which may be the one I'm looking for. So I know this IS API stuff. However, I don't see it anywhere in the windows.h list. Is it even in there? And if so, how can I utilize it? If I can do this through Lite-C, it will save me the loads of frustration of doing different projects in C++, when I can just use Lite-C and be done with it.

So if you know anything about this, please advise. smile

Re: Windows API: Text Box [Re: Jaeger] #271583
06/14/09 01:30
06/14/09 01:30
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
That article on MSDN is about the TextBox class that is part of the .NET Framework which is NOT the WinAPI (same applies to the richtext editor). However, text boxes are probably part of the WinAPI as well but you won't be able to use them inside a DirectX instance. You will have to write your own textbox class that is rendered by the engine. Open/Save dialogues are part of the WinAPI and can easily be used (but don't confuse them with their counterparts in the .NET Framework).


Your friendly mod is at your service.
Re: Windows API: Text Box [Re: MichaelGale] #271650
06/14/09 10:24
06/14/09 10:24
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Ok, I guess I was confused about what I was reading then. I see what you mean now. I heard before that you couldn't use things like this in Direct-X, but I was thinking about doing it externally anyway, for certain things.

But, I'd actually enjoy creating my own textbox class. smile I'm just not sure where to start so I can make one that's useable with the engine. If this was just C/C++, I could use the text box classes they already have, or, write a new one right in VC++. But what's it going to take to make one for the engine? Am I supposed to do this externally, with VC++? Or am I just defining a class/struct in Lite-C coding for the project I'm working on? I've never done anything like this to be used with the engine...

Re: Windows API: Text Box [Re: Jaeger] #271722
06/14/09 18:04
06/14/09 18:04
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Code:
editor_string = ""

def key(k):
    global editor_string
    s = str_for_key(k)
    if s == "enter":
        s = "\n"
    if s == "space":
        s = " "
    if s == "bksp":
        editor_string = editor_string[:-1]
        return
    editor_string += s

e.on_anykey = key

@schedule
def main():
    while 1:
        draw_text(editor_string, 10, 10, (255,255,255))
        yield(1) # wait(1)
have you tried something like that? it's written in python but you should get the idea. with some string manipulation (which could be a bit cumbersome in lite-c) and str_width() you should be able to do a complete text editor in this or a similar way.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1