• Login
Community
  • Login

How to setTextColor in DockingDlgInterface Window

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
3 Posts 2 Posters 291 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    Thomas Knoefel
    last edited by May 17, 2023, 6:18 PM

    Hi all,

    I’m currently working on a plugin in C++, and I’m almost finished, but I’m facing a problem.

    I’m trying to display a colored text on the panel of the Plugin Window (::DockingDlgInterface) for a status message, but it seems to be impossible.

    I have a TextField of type WC_STATIC, and I want to change its color using the WM_CTLCOLORSTATIC event. However, this event doesn’t seem to be triggered. Even if I try to set the color during the window’s initialization (what i just did for testing), it still won’t change. The NPP theme is always dominating the colors.

    It would be great if someone could let me know if I’m completely off track or share some tips on how to tackle this. Thxs

    A 1 Reply Last reply May 17, 2023, 6:40 PM Reply Quote 1
    • A
      Alan Kilborn @Thomas Knoefel
      last edited by Alan Kilborn May 17, 2023, 7:42 PM May 17, 2023, 6:40 PM

      @Thomas-Knoefel

      I did a quick test of the advice given HERE and it seemed to work in a docking plugin context.

      I only tried it in N++'s default theme, because you didn’t indicate which theme might be giving you trouble. With “dark mode” enabled it didn’t set the color; again, not sure if that is the setup you’re asking about because you didn’t say.

      EDIT: Ok, I’ll hazard a guess that you were talking about “dark mode”, because in non-dark mode if you choose a different theme from the default, the color scheme from that theme doesn’t change the coloring of anything on the docking dialog.

      EDIT: I’m not really sure what the “design plan” is for dark mode and such colors. I suppose it is allowed, as the Find window in dark mode has a color-capable status bar:

      76d4f843-5485-444d-a533-d11cfd9b1934-image.png

      Ideally, the plugin programmer could simply ignore dark mode and things would “just work”, but this often doesn’t seem to be the case, here’s another such reference: https://github.com/npp-plugins/plugindemo/issues/4

      1 Reply Last reply Reply Quote 1
      • T
        Thomas Knoefel
        last edited by Thomas Knoefel May 18, 2023, 9:05 AM May 18, 2023, 8:35 AM

        Alain, You’re correct, I started testing exclusively in Dark Mode and haven’t gotten to Light Mode yet. Your screenshot is exactly what I was trying to achieve… I have avoided diving into NPP’s code until now, as it might be too time-consuming.

        Thanks for the useful links and info. I’m eager to test them out and see how they help. However, you have a point - maybe it’s best to ignore color issues for now since Dark Mode doesn’t fully support them yet. And colors are not part of the key functionality.

        Also, while implementing, I noticed a couple of bugs related to themes. One is a refreshing problem with comboboxes (not selected lines are pitch black) only in Light Mode (but surprisingly not happening in all Windows installations), and the other is about the color scheme of a disabled list in Dark Mode. I’ll report these on Github.

        1 Reply Last reply Reply Quote 2
        1 out of 3
        • First post
          1/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors