Custom Pane - Highlight When Active Pane

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Support,

I've implemented a few of my custom panes (inside MainView and DocumentView) - and all works as expected except one thing.

What do I need to do to ensure highlight of the title/caption/header area of my custom pane when it gets activated (by clicking inside any of controls it hosts):

Note the image:

image.png

"Search" and "History" are "standard" panes. "Bookmarks" is my custom pane.

History pane is active (has input focus) and hence its title/caption/header has the "hightlight" color.

When I click inside my custom pane - I'd like it to get highlighted.

p.s.
Further info: when my pane is not visible and I make it visible - the header blinks - that's ok.


-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Hi Zarko.

Our UI framework keeps track of all keyboard focus changes and highlights the title and border of a panel when that panel or any of its descendants receives focus. But when you embed your own UI that was built without using our UI framework, this mechanism will not work, because in this case our user interface is unaware of the focused foreign control in this embedded user interface. You may try to solve this issue by assigning our IUIX_Obj to all your windowed-items(that may grab a focus) in such embedded UI, by special 'subclassing' of it:

Code: Select all

class stubObjImpl : IUIX_ObjImpl
{
};

UIX_CreateObjParams cp = {0};
cp.pImpl		= new stubObjImpl;
cp.pParent		= pPaneObj;
cp.nObjStyle = uiInst.MakeObjStyle(0, UIX_ObjStyleEx_SimpleWndWrapper);
cp.hWnd		= (HANDLE_T)hWndToSubclass;
g_uiInst.CreateObj(&cp);
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Vasyl,

Ok, thanks, the "why" is clear.

Can I "simply" set some style flag to the pane's title/border when my ui controls receive focus (without subclassing)?

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Unfortunately, there is no other way to do this...
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Vasyl,

You sample code is much similar to what I already have when creating the pane : https://forum.pdf-xchange.com/viewtopic.php?f=66&t=33346&p=139754&hilit=UIX_ObjStyleEx_CustomPaintWnd#p139821

Am not sure what exact implementation would need to go into On[Pre|Post]Event for "cp.pImpl" - so for the highlight to happen.

Also, would it "simply" be possible to FireEvent, say e.InputFocusGained and send it to ?

So, once controls (on my pane) receive focus I send e.InputFocusGained to pane's parent or pane's View or pane's LayoutItem ?

You said:
... and highlights the title and border of a panel when that panel or any of its descendants receives focus.
Essentially I'm looking for code that does that - highlights the title and border.

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Am not sure what exact implementation would need to go into On[Pre|Post]Event for "cp.pImpl" - so for the highlight to happen.
Just keep it empty. Or return from it with Event.Handled==false at least. Such lightweight wrapper-objects are only to bound editor's UI-framework and your UI together, to have ability to intercept focus-change events by our UI-events dispatcher too...
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Vasyl,

I've tried implementing what you suggested - but nothing happens :(

Any chance you can edit the CustomPane demo to make it work...


zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Vasyl,

Actually ... I made it :) It is working as you suggested.

I had to iterate over all controls on my pane and setup subclassing and correct parentage for created IUIX_Obj's.

And also had to set the RC field of the UIX_CreateObjParams.

Also, the "cp.pImpl = new stubObjImpl;" is actually not needed.

-žarko
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Custom Pane - Highlight When Active Pane

Post by TrackerSupp-Daniel »

:)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Support,

Too happy too early :)

All this above works as expected but with some side effects...

(Beside other controls) I'm using the SysTabControl32 on my custom pane.

Once I "subclass" my controls (as described above), my tab control no longer receives the TCN_SELCHANGE notification when I click a tab to change the active tab.

I will try to dig deeply to try to figure out why - but maybe, just maybe, you have some idea about the "why" (I suspect your internal message handling mechanism somehow swallows this specific wm_notify)...

-žarko
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Support,

Beside the above mentioned issue, I've noticed one more:

Once I implement the "subclassing" (as suggested): text edit type controls, when the mouse moves over them: the mouse cursor is not changed to "beam".

So, in essence - something gets messed up with Windows messages...

p.s.
If possible please add some method to manually set "highlight style" to the pane's IPXV_View - I will then keep track if any of the controls within have the input focus...

Of course not a show stopper request - just would be nice ;)

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Hi Zarko.

Soon I will investigate your case and let you know about result, good or not...

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Tried to reproduce your issue using CustomPane sample. We modified it:
1. Added the tab-control with overridden tabControl1_SelectedIndexChanged method to see how it works after subclassing
2. Subclassed the userCtrl.Handle and all its descendants with UIX_ObjStyleEx_SimpleWndWrapper flag.

All works well, including such tab-control. Excepting the issue with UIX_CreateObjParams::rc member using, mentioned by you. We will fix that in the next build and you will be able to leave it empty with UIX_ObjStyleEx_SimpleWndWrapper flag specified to keep subclassed windows as is, in their current positions...

So it will be helpful if you will provide a simple example project (.NET/C++ is preferable) to reproduce your issue on our side...

Cheers,
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Vasyl,

Thanks. I'll dig deeply (as I'm using Delphi).

Btw, are you using SetWindowSubclass or ?

p.s.
I guess you know this: when a pane (not custom) is in floating state - it does not get highlighted when input focus received:
image.png



-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Custom Pane - Highlight When Active Pane

Post by Vasyl-Tracker Dev Team »

Hi Zarko.
Btw, are you using SetWindowSubclass or ?
No, technically it is:
WNDPROC pOldWndProc = SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)pNewWndProc);
and then, when event isn't handled by pNewWndProc - the previous pOldWndProc is called by CallWindowProc(pOldWndProc, hWnd...);
In case when the UIX_ObjStyleEx_SimpleWndWrapper is specified then pNewWndProc doesn't handle events and just relay them to the pOldWndProc. In this case, the pNewWndProc is used mostly to monitor the focus-change events.
I guess you know this: when a pane (not custom) is in floating state - it does not get highlighted when input focus received:
Yes, because such floating windows have a standard window's caption and border and in most win-themes this does not change it's appearance when the focus is changed. We decided to keep standard window's frame for such floating windows&dialogs. Because in Windows any customization of the non-client area - it's one big and painful problem...

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom Pane - Highlight When Active Pane

Post by zarkogajic »

Hi Support,

Thanks! In v362 my custom panes now do have their title/caption highlighted when any control inside has the focus (without me doing this) :)

User avatar
Paul - Tracker Supp
Site Admin
Posts: 6829
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Custom Pane - Highlight When Active Pane

Post by Paul - Tracker Supp »

:)
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply