Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I make the cursor in a MultilineTextEditBoxWidget move up and down using the arrow keys?

Explorer ,
Apr 03, 2025 Apr 03, 2025

When I enter multiple lines of text in a MultilineTextEditBoxWidget, I want to be able to move the cursor up and down using the up and down arrow keys. However, currently, the cursor can only move left and right.

I'm not sure if this is due to a missing parameter setting or if the MultilineTextEditBoxWidget provided by the SDK does not support this functionality. However, I noticed that in InDesign's PDF Export dialog, the multiline input field already supports this behavior.

TOPICS
SDK
777
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Apr 11, 2025 Apr 11, 2025

Differences:

kBindNone

large nudge = 0

upper bounds = 100

notify keystrokes = false

 

Plenty speculation ahead:

 

My guess is the notify keystrokes flag. kTrue is rare in the SDK examples, and I doubt it is intentional for kSpellAlternativeEditBoxID. Could be the key strokes are absorbed with this flag.

Given the (NEW) comment, I assume you copied it from kPDFVTUIDataSourceFileTextWidgetID or kWatermarkUIEditBoxWidgetID. Have you tried with false as I already suggested above?

 

Otherwise it could be some e

...
Translate
Explorer ,
Apr 08, 2025 Apr 08, 2025

Snipaste_2025-04-08_22-49-11.png

As shown in the image, the multi-line text box in this PDF export dialog supports moving the cursor up and down using the arrow keys. I defined the following type:

 

cpp
复制编辑
type EVEMyMultilineTextEditBoxWidget(kViewRsrcType) : EVEMultilineTextEditBoxWidget(ClassID = kTextEditBoxWidgetBoss) { };
 

However, when I define my edit box control using the EVEMyMultilineTextEditBoxWidget type and input multiple lines of text, the cursor is actually not able to move up and down using the arrow keys.

Does anyone know which k...Boss I should use to enable this functionality?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 08, 2025 Apr 08, 2025

Tagging @Dirk Becker

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 10, 2025 Apr 10, 2025

The type looks ok, kPDFDescritionTextWidgetID uses the same.

 

You should also have quoted your actual fr, e.g.

The IControlView uses typical kSysEditBoxRsrcId,kAppUIPluginID, and is enabled.

IID_IEDITBOXATTRIBUTES has both flags (readonly, and want key stroke) set to kFalse.

Data validation is also disabled.

 

Not sure whether anything of that is relevant.

I looked only at the Mac.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2025 Apr 10, 2025
EVEMyMultilineTextEditBoxWidget// Watermark text field
(
kMyeditboxWidgetID, // WidgetId
kSysEditBoxPMRsrcId, // RsrcId
kBindLeft | kBindRight ,
Frame(0,0,200,200) // Frame
kTrue, kTrue, // Visible, Enabled
0, // widget id of nudge button
1, // small nudge amount
10, // large nudge amount
0, // max num chars(0 = no limit)
kFalse, // is read only
kTrue, // should notify each key stroke (NEW)
kFalse, // range checking enabled
kFalse, // blank entry allowed
0,
0, // upper/lower bounds
"", // initial text
kEVENoSpaceAfter| kEVEAlignFill,
),     
this is  my editbox  code at .fr.  and I develop  plugin at windows
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 11, 2025 Apr 11, 2025

Differences:

kBindNone

large nudge = 0

upper bounds = 100

notify keystrokes = false

 

Plenty speculation ahead:

 

My guess is the notify keystrokes flag. kTrue is rare in the SDK examples, and I doubt it is intentional for kSpellAlternativeEditBoxID. Could be the key strokes are absorbed with this flag.

Given the (NEW) comment, I assume you copied it from kPDFVTUIDataSourceFileTextWidgetID or kWatermarkUIEditBoxWidgetID. Have you tried with false as I already suggested above?

 

Otherwise it could be some extra setup code, maybe using a private Drover call. Once upon a time IControlView had a getter for the SysControl / HWND so we could look at the Windows side, but that's gone. If I were desperate I'd try Windows API such as EnumChildWindows() and dig deeper from there.

 

If you only need the key strokes to update a related display, you could also watch InDesign's events. To learn about focus / blur, observe your kMyeditboxWidgetID for protocol IID_IEVENTHANDLER, message is kEditBoxGetKeyFocusMessage or kEditBoxGiveUpKeyFocusMessage. Between those, register/unregister an IEventWatcher at IEventDispatcher. Works at least here on the Mac.

 

There is also a very old "filter" programming pattern to subclass the boss class, move the event handler implementation to another IID (any of yours will do) and provide your own event handler that passes on most calls. Somewhere deep in the SDK it is mentioned that event handlers are discouraged, so you better also stay away from that.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 11, 2025 Apr 11, 2025
LATEST

Thank you very much for your explanation. The issue has been resolved. The problem was caused by the small nudge value. Once I set small nudge to 0, it worked correctly. It seems that small nudge and large nudge are used in single-line text editors, where pressing the up/down arrow keys can adjust the numeric value in the editor. However, in this case, I’m using a multi-line text editor, where such behavior is not needed. So both values should be set to 0.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines