UI Apperance - Backgrounds - change from code  SOLVED

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.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

UI Apperance - Backgrounds - change from code

Post by zarkogajic »

Hi Support,

How can I change the background style from code, as in:

image.png

I've tried via IUIX_ObjImpl for IPXV_DocumentViewsArea and e_Render and IUIX_RenderContext and FillUpdateRegion, but the result is not how it should be (not because of the selected color :)):

Code: Select all

PDFXEdit.IUIX_RenderContext pRC = (PDFXEdit.IUIX_RenderContext)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown((IntPtr)pEvent.Param1);
pRC.FillUpdateRegion((int)0xFF00FF, false);
image.png
If I use

Code: Select all

pRC.FillUpdateRegion((int)0xFF00FF, TRUE); // no change at all?
image.png

What's wrong with that code?

Also, how do I specify the style/pattern?


-žarko
You do not have the required permissions to view the files attached to this post.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: UI Apperance - Backgrounds - change from code

Post by zarkogajic »

Hi Support,

I've played a bit .. what I actually need is:

IUIX_Theme.SetColor('main.bg', $FFFFFF, false);

BUT not globally!

Only for a particular MainFrame / IPXV_DocumentViewsArea.

Can this be done?

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: UI Apperance - Backgrounds - change from code

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Changing the Theme colors result in changing of the whole UI of the Application as the theme is one for all - not just one frame. Though changing the Theme is a correct way of doing what you want.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: UI Apperance - Backgrounds - change from code

Post by zarkogajic »

Hi Alex,

Thanks. I need this (some "look" change) for only one Frame/View/DocView/PagesView.

I've tried changing the Obj.Style property for IPXV_DocumentViewsArea/IPXV_DocumentView/IPXV_PagesView by including UIX_ObjStyle_NoBackground/UIX_ObjStyle_NoInnerShadow - but no change in rendering.

Is there any way, using some style value (or something else), to somehow change the look of at least the IPXV_PagesView ?

So, anything that would change the look of the PagesView background:

image.png

?

-žarko
You do not have the required permissions to view the files attached to this post.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: UI Apperance - Backgrounds - change from code  SOLVED

Post by zarkogajic »

Hi Alex,

Seems like IPXV_PagesView::RegisterDrawCallback does the trick :)

With nStage set to PXV_PagesViewDraw_AfterBackground, and this code in OnDrawPagesView: prc.FillUpdateRegion($FEFEFE, false); the result:

image.png

-žarko
You do not have the required permissions to view the files attached to this post.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: UI Apperance - Backgrounds - change from code

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Glad that you found what you need :)

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ