S'morz... Er, some more... B+ questions. ^_^

BlitzPlus Forums/BlitzPlus Programming/S'morz... Er, some more... B+ questions. ^_^

Adam Novagen(Posted 2008) [#1]
Okies, I've got a couple of questions this time.

1: How can I create keyboard "hotkey" shortcuts, you know, like Ctrl+S, Ctrl+O, that kind of thing.

2: After you've created a menu using CreateMenu(), is it possible to remove that menu later in the program's execution? So for instance:

Global MainWindowMenu = CreateWindowMenu(MainWindow)
Global Menu_File = CreateMenu("File",100,MainWindowMenu)
Global Menu_File_Open = CreateMenu("Open File...",101,Menu_File)

In this example, is it possible to remove the menu item Menu_File_Open later in the program, and if so, how?

3: Is there any way to select/highlight certain blocks of a text in a Text Area gadget?

4: If the user selects a block of text inside a Text Area gadget, is it possible to "read" the highlighted text?

5: When checking to see if a key has been typed inside a Text Area gadget, is it possible to find out exactly which key was pressed?

Thanks in advance everyone; Ciao!


Dabhand(Posted 2008) [#2]
1) HotKeyEvent
2) Can you just recreate the menu, minus Menu_File_Open
3) Not that I recall
4) TextAreaCursor, TextAreaSelLen, TextAreaChar
and other can be nobbled together to do this
5) I'm sure there is an event for key presses $101 or $102, I cannot remember, but this event returns the scancode for the key.

I dont have B+ anymore, and this is just from memory... Hope it helps! :)


Adam Novagen(Posted 2008) [#3]
Thanks Dabhand! Only having the demo version, I didn't know half of those commands even existed; I'll be sure to try them out!

With regards to the menu item though, I do need to be able to remove menus during program execution; they're listing the open files, so in other words, each active file has its own menu entry. Right now I'm getting by with DisableMenu(), but that doesn't really clean up the interface properly.


Dabhand(Posted 2008) [#4]
No problem... If your after docs, could you not try the online version:-

http://www.blitzbasic.com/bpdocs/docs.php

They seem as up to date as the offline ones.