You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
I have read the help text for MENU ADD STRING and ACCEL ATTACH, but it is not clear how to allow multiple hotkeys for the same item.
Cut: SHIFT-DEL and CTRL-X
Copy: CTRL-INS and CTRL-C
Paste: SHIFT-INS and CTRL-V
Does DDT support doing this?
Don't know about the APPCOMMAND_xxx messages, but WM_CUT, WM_COPY and WM_PASTE are sent to the edit control (not the owner window) (By the appliocation) to force the control to do that thing. (default procedure should do it).
Show your screen code. If you use a edit/TEXTBOX control these keys should all work without you doing anything. (for edit for sure, for TEXTBOX I'm not so sure). (Not a DDT guy).
%WM_CUT etc are equates for messages sent to edit (and combobox) controls.
You shouldn't use them directly as IDs (e.g. for menu items).
Normally what you would do is assign our own equates to your menu item (or button etc). e.g. %IDM_CUT = 1001
Then write callback code to respond to that item being clicked / selected...
Code:
Case %WM_COMMAND
Select Case As Long CbCtl
Case %IDM_CUT
Control Send CbHndl, %IDC_TEXTBOX1, %WM_CUT, 0, 0
As MCM pointed out, these behaviours - cut, copy, paste etc are built in to Edit/TextBox controls
and have hotkeys assigned to them automatically by the sytstem (even in DDT programs).
If you want to implement those operations in a different kind of control (say a listbox), or add
your own hot keys, you'll need to 'roll your own' and assign an accelerator table entry for each
hot key combination. Two or more Accel table entries can point to the same command.
.. hotkeys assigned to them automatically by the sytstem (even in DDT programs).
Well, if DDT uses the default behavior for edit controls, a context menu with these standard text operations should appear when you right-click in the control, too.
(It does with SDK-style).
I use Ctrl+A, Ctrl+C, Shift+Insert (I forget the Crtrl+something key for paste) all the time with these controls.
They all work just the same in DDT, including the right click menu without any extra code.
The 3 main control codes are in a row on a standard English keyboard Ctl-X is Cut, Ctl-C is Copy , Ctl-V is paste. The first key in the row Ctl-Z is normally Undo, though its exact action can vary between programs and Ctl-A above them is Select All.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment