Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

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

Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by zarkogajic »

Hi Support,

I'm programmatically injecting a check box to the SearchView pane (between Search and Options buttons) :

image.png
image.png (19 KiB) Viewed 1253 times

What style should I set for that IUIX_Label so that "btn.options" never goes over it, when the full dlg width is small?

image.png
image.png (19.49 KiB) Viewed 1253 times

Much like how it does not go over the "btn.startStop", and always renders "after" it (check box hidden now):

image1.png
image1.png (22.55 KiB) Viewed 1253 times

Edit1:
Also, how do I force a Tooltip to display for that Label?



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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by zarkogajic »

Support?

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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

How are you "injecting" it exactly?

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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by zarkogajic »

Hi Alex,

1. Get IPXV_SearchView from MainFrame.View.Panes
2. Get IUIX_Dialog from it
3. Get "btn.startStop" IUIX_Button on it
4. IUIX_Inst.CreateLabel having IUIX_Dialog [2] as parent
5. Push custom IUIX_ObjImpl for the "btn.startStop" button
6. In button's e_Render read its Rect
6.1. "Move" rect to the right
6.2. Set label's rect (so it is next/right to that button).

Works like a charm ;)

What I could do is to also move "btn.options" to the right of label's rect - and I think that could work - but I was hoping for some style setting or something like that - as I do not like this moving/repositioning in "btn.startStop" e_Render.

p.s.
I'm also setting Tooltip for the label - but am not sure how to force its display.


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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

The thing is that the Label that you are adding appears with the topmost position - this it overlaps everything.
Try creating it like this:

Code: Select all

UIX_CreateObjParams cp;
cp.pParent = pParent;
cp.nStdClass = UIX_StdClass_Label;
cp.nObjStyle = nStyle;
cp.nCreateFlags = UIX_CreateObj_InsertBefore;
cp.pID = pID;
cp.pImpl = pCustomImpl;
cp.rc = pRect;
IUIX_Obj obj = uiInst.CreateObj(ref cp);
IntPtr outPtr;
obj.Parent.QueryImpl(typeof(PDFXEdit.IUIX_Label).GUID, null, out outPtr);
PDFXEdit.IUIX_Label label = (PDFXEdit.IUIX_Label)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
The UIX_CreateObj_InsertBefore flag should insert it as a first item, not last.

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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by zarkogajic »

Hi Alex,

This ends up with the same result:

image.png
image.png (12.24 KiB) Viewed 1168 times

BUT also:

image1.png
image1.png (10.25 KiB) Viewed 1168 times


Btw, having nCreateFlags = UIX_CreateObj_InsertBefore - what do you specify for "nInsertBefore" ?


-žarko
Last edited by zarkogajic on Thu Jun 04, 2020 1:23 pm, edited 1 time in total.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Ah, forgot to mention that - the nInsertBefore field - try setting it to 0 for example.
Probably that's why it didn't work.

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

Re: Adding/injecting IUIX_ObjImpl (Label) onto an IUIX_Dialog

Post by zarkogajic »

H Alex,

Tried with 0 and 1 and -1. Always the same.

I believe something special is going on behind the scenes as the Options button is always aligned to the right - but never goes over Start/Stop button.


-žarko
Post Reply