issue-#180 fixing resource lookup in OleClient.PasteSpecial

Re: IsNewInSymFile

Postby DGDanforth » Sat Oct 28, 2017 4:56 am

Josef,
So you are saying there is no need to modify Dev/Rsrc/Strings,
just put everything into Ctls/Rsrc/Strings?

I've done that and it seems to work fine.

Hence the Quick-Start documentation for Ctls needs to change to reflect that fact.

-Doug
User avatar
DGDanforth
 
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA

Re: IsNewInSymFile

Postby Josef Templ » Sat Oct 28, 2017 10:20 am

DGDanforth wrote:Josef,
So you are saying there is no need to modify Dev/Rsrc/Strings,
just put everything into Ctls/Rsrc/Strings?

I've done that and it seems to work fine.

Hence the Quick-Start documentation for Ctls needs to change to reflect that fact.

-Doug


Right. The Quick-Start actually gets simpler then because copying things to Strings can be removed at all.
This holds for both Quick-Start files. The authors should update both (or check if both are required).

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: IsNewInSymFile

Postby Robert » Sun Oct 29, 2017 10:59 am

Josef Templ wrote:There is a simple solution for Ctls, I think.
You can specify all the inspector properties in Ctls/Rsrc/Strings if you remove the "Ctls" prefix.
For example use: ...

That does work, and is advantageous in reducing dependencies.

A few CPC documents will need to be updated: Modules I use include: CtlsButtons, CtlsRealField, CtlsUnitField, CtlsSets, CtlsSetsF, & LibSliders.

The corresponding inspector strings for CtlsFigures are already in Ctls/Rsrc/Strings, and do NOT have their "Ctls" prefix removed.

Personally I find this all rather confusing. In an ideal world there would be a document that clearly explained what Strings files can be used for, and how to use them.
User avatar
Robert
 
Posts: 1023
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: IsNewInSymFile

Postby Robert » Sun Oct 29, 2017 11:23 am

A similar problem occurs when using Strings with file converters.

To be specific there is a "Rich Text" converter called CasketRtfConv (its advantage over the standard Rtf converter is that it can export bitmaps).
To cleanup the entries in the File→Save & File→Open dialogs I originally suggested putting the strings
Code: Select all
CasketRtfConv.ImportDRichText   Rich Text (Casket)
CasketRtfConv.ExportRichText   Rich Text (Casket)

into Host/Rsrc/Strings, thus making it non-standard.

I then discovered they could be put into Casket/Rsrc/Strings.
This works for the File→Save & File→Open , but NOT for Edit→Paste Special... . For that, the non-standard string must be left in the Host Strings file.
User avatar
Robert
 
Posts: 1023
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: IsNewInSymFile

Postby Josef Templ » Sun Oct 29, 2017 4:57 pm

Robert wrote:Personally I find this all rather confusing. In an ideal world there would be a document that clearly explained what Strings files can be used for, and how to use them.


Agree.
The special thing with the Inspector seems to be that resource keys are looked up at two places,
the Dev subsystem AND the control's subsystem. When looked up in Dev it prepends the subsystem in order
to avoid accidental key clashes. In the control's subsystem there are no such name clashes and the subsystem is omitted.
I don't know why the lookup sequence is required and if it is really required.

I only know this because I looked up the source code. I don't know if it is documented anywhere and what
kind of other special behavior is still undiscovered.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: IsNewInSymFile

Postby Josef Templ » Sun Oct 29, 2017 5:25 pm

Robert wrote:I then discovered they could be put into Casket/Rsrc/Strings.
This works for the File→Save & File→Open , but NOT for Edit→Paste Special... . For that, the non-standard string must be left in the Host Strings file.


The picture becomes pretty clear now.
At the beginning (of BlackBox) all the keys for Inspector were in Dev and the keys for Ole in Host.
Then ominc discovered that there is a problem with extensibility
and added a lookup in the control's subsystem for the Inspector. Now the Inspector searches both the Dev and the control's subsystem.
The same extension has been made to HostCmds, HostDialog, etc.
Unfortunately they overlooked it in OleClient.PasteSpecial.

To me this looks like a real bug but it could be resolved easily.

- Josef
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: IsNewInSymFile

Postby Robert » Mon Oct 30, 2017 9:10 am

Josef Templ wrote:To me this looks like a real bug but it could be resolved easily.

It would be an improvement not to have to use non-standard versions of both Dev/Rsrc/Strings &
Host/Rsrc/Strings.
User avatar
Robert
 
Posts: 1023
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

issue-#180 fixing resource lookup in OleClient.PasteSpecial

Postby Josef Templ » Mon Oct 30, 2017 12:44 pm

I have created issue https://redmine.blackboxframework.org/issues/180 for fixing the bug
discovered by Robert above.

See the diffs at https://redmine.blackboxframework.org/projects/blackbox/repository/diff?utf8=%E2%9C%93&rev=a3be4858ae833cb742a26843437d9a9eb7ff856f&rev_to=27796f3ad22a448bc6efc7920c54d80ebbe1ce2a.

I tried to keep as much unchanged as possible and followed the convention in HostDialog (used for File->Open etc).
This means that the resource key must be complete, including the subsystem name.
@Robert: Just put
Code: Select all
CasketRtfConv.ImportDRichText   Rich Text (Casket)
CasketRtfConv.ExportRichText   Rich Text (Casket)

unmodified into the Casket Strings file.

Since I observed inconsistencies between return type names used in the Config file and the keys in Host Strings, I added
several keys so that both, XXX.View and XXX.StdView work.

- Josef
Last edited by Robert on Tue Oct 31, 2017 9:35 am, edited 1 time in total.
Reason: Updated a link
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#180 fixing resource lookup in OleClient.PasteSpec

Postby Robert » Mon Oct 30, 2017 2:16 pm

Build 981 is working fine for me - thanks.

Josef - My memory is playing me tricks: Did you say something about simplifying the 3-dimensional CHAR array?
User avatar
Robert
 
Posts: 1023
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#180 fixing resource lookup in OleClient.PasteSpec

Postby Josef Templ » Mon Oct 30, 2017 3:04 pm

Robert wrote:Build 981 is working fine for me - thanks.

Josef - My memory is playing me tricks: Did you say something about simplifying the 3-dimensional CHAR array?


Yes, originally, but I had to edit that comment shortly after I had posted it.
str is used indeed but it is not obvious.
There are address assignments to a WinApi string pointer, not string copies, as it looks like.
That's why I had to keep str unchanged.

- Josef

P.S. By the way, in the meantime I also set AppVersion.txt to release candidate 1, i.e. rc1.
User avatar
Josef Templ
 
Posts: 2038
Joined: Tue Sep 17, 2013 6:50 am

PreviousNext

Return to Resolved (Bugs)

Who is online

Users browsing this forum: No registered users and 1 guest

cron