Quantcast

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Eike Rathke-6
Hi Mathias,

On Thursday, 2010-10-21 17:41:45 +0200, Mathias Bauer wrote:

>          Title: Treatment of HelpIds changed
> Effective from:  CWS changehid

What exactly do developers working on a CWS that introduces new HIDs
have to do after having rebased that to a milestone where CWS changehid
was integrated?

  Eike

--
 OOo Calc core developer. Number formatter stricken i18n transpositionizer.
 Signature key 0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
 --
 Please don't send mail to the old [hidden email] account that I used for mailing
 lists, it phased out. Use [hidden email] instead. Thanks.

attachment0 (200 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Mathias Bauer
On 21.10.2010 19:30, Eike Rathke wrote:

> Hi Mathias,
>
> On Thursday, 2010-10-21 17:41:45 +0200, Mathias Bauer wrote:
>
>>           Title: Treatment of HelpIds changed
>> Effective from:  CWS changehid
>
> What exactly do developers working on a CWS that introduces new HIDs
> have to do after having rebased that to a milestone where CWS changehid
> was integrated?
>
>    Eike
>

Replace the number by a string, I gave an example on the wiki page.
Look at the existing helpid.hrc files, it should be easy to understand.

Let's assume you have

        HelpId = HID_FOO_BAR;

in your src file and

        #define HID_FOO_BAR SC_HID_START+4711

or so in your helpid.hrc file. With the changes in cws changehid this
won't compile anymore as the rsc thankfully points developers to all
places that still use numbers instead of strings.

The easiest way to get your compiled would be to just change the hrc
file  to

        #define HID_FOO_BAR "SC_HID_FOO_BAR"

(assuming that the file belongs to the sc module). That's all.

The same applies if you have code like

        SetHelpId( HID_FOO_BAR );

If controls shall be accessible to auto tests or help content, they now
will need to get a HID assigned explicitly, the auto-HID feature of the
resmgr is gone. That's the small price to pay for getting rid of the
ridiculous HID compilation process and all the problems related to the
use of hid.lst.

Do you think that I should explain that more detailed in the wiki?

Regards,
Mathias

--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[hidden email]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Frank Schönheit
Hi Mathias,

> If controls shall be accessible to auto tests or help content, they now
> will need to get a HID assigned explicitly, the auto-HID feature of the
> resmgr is gone. That's the small price to pay for getting rid of the
> ridiculous HID compilation process and all the problems related to the
> use of hid.lst.

Which is the ugly part of the (otherwise great) change :-\

If the layout manager, and the XML based dialog format, will not come to
our code base soon (Christian??!), it might be worth thinking of another
change: replace resource IDs with strings. The advantage (besides
getting rid of those ugly .hrc files) would be that the resource
compiler could again generate auto-help-ids, e.g. from
  Dialog "MyCoolDialog"
  {
    PushButton "Apply"
    {
      ...
    }
  };
, it could generate something like
"org.openoffice.org://dialogs/<module>/MyCoolDialog" and
"org.openoffice.org://dialogs/<module>/MyCoolDialog/Apply" as help
IDs/URLs ...

Well, yes, having an XML-based resource format, where resource elemtns
have string identifiers, too, would remove the need for such a change to
the resource compiler ...

Ciao
Frank
--
ORACLE
Frank Schönheit | Software Engineer | [hidden email]
Oracle Office Productivity: http://www.oracle.com/office

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Frank Schönheit
> "org.openoffice.org://dialogs/<module>/MyCoolDialog" and
> "org.openoffice.org://dialogs/<module>/MyCoolDialog/Apply" as help

should have been "org.openoffice.help://*" ...

Ciao
Frank

--
ORACLE
Frank Schönheit | Software Engineer | [hidden email]
Oracle Office Productivity: http://www.oracle.com/office

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [interface-announce] required/ CWS changehid : Treatment of HelpIds changed

Mathias Bauer
In reply to this post by Frank Schönheit
On 10/22/2010 09:14 PM, Frank Schönheit wrote:

> Hi Mathias,
>
>> If controls shall be accessible to auto tests or help content, they now
>> will need to get a HID assigned explicitly, the auto-HID feature of the
>> resmgr is gone. That's the small price to pay for getting rid of the
>> ridiculous HID compilation process and all the problems related to the
>> use of hid.lst.
>
> Which is the ugly part of the (otherwise great) change :-\
>
> If the layout manager, and the XML based dialog format, will not come to
> our code base soon (Christian??!), it might be worth thinking of another
> change: replace resource IDs with strings. The advantage (besides
> getting rid of those ugly .hrc files) would be that the resource
> compiler could again generate auto-help-ids, e.g. from
>    Dialog "MyCoolDialog"
>    {
>      PushButton "Apply"
>      {
>        ...
>      }
>    };
> , it could generate something like
> "org.openoffice.org://dialogs/<module>/MyCoolDialog" and
> "org.openoffice.org://dialogs/<module>/MyCoolDialog/Apply" as help
> IDs/URLs ...

I considered that, but it would have been an even heavier change. You
won't believe it before you see it: resource IDs are used in
calculations even more than help ids. But there are more "nice" use cases.

I found code that only works if a RID for a string and a slot id have
the same offset to some base numbers. Sometimes RIDs have been used as
identifiers in other APIs ("I need a numerical identifier - hey, we have
the resource ID, how nice, let's use it!").

etc. etc.

Switching resource IDs would have postponed the cws changehid for
another few months.

In the meantime I expect that the number of new dialogs or tab pages
will be manageable. Adding HIDs by a script is a small price, IMHO. Even
manual adding of HIDs takes only a few minutes as a one-time operation
(how many new dialogs do you write per week?).

> Well, yes, having an XML-based resource format, where resource elemtns
> have string identifiers, too, would remove the need for such a change to
> the resource compiler ...

Yes, I think that this is the right way to go. For the existing src
files the removal of auto-HIDs isn't a problem, all files have been
converted already. Implementing a new resource format and using it for
new UI probably won't take longer than switching the existing code base
to string based resource IDs.

Regards,
Mathias

--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[hidden email]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...