On Oct 8, 2006, at 1:09 PM, Erne wrote:

Hi Charles,

On 8-ott-06, at 02:00, Charles Yeomans wrote:

I've written an HISearchField control for use outside the toolbar. This is the real thing, not some shoddy clone like you can find on the web. It worked when it left here, and appears to play well with the REALbasic framework. It's undocumented and the code could use a little tidying, but perhaps it will do for now. The project is available for download at <http:// www.declareSub.com/>.


I downloaded your great HISearchField (never thankful enough for your generosity!)
and wanted to tweak the MacMenu style methods a bit
(as they are now you can't set more than one style at once, and can't even set off a style you've set on)

so I've made this little function to get the previously set value

Function GetItemStyle(index as Integer) As MemoryBlock
  #if TargetCarbon
    If me.Ref = 0 then
      Return nil
    End if

Soft Declare Sub GetItemStyle Lib CarbonLib (theMenu as Integer, item as Short, chStyle as Ptr)

    dim style as new MemoryBlock(sizeOfStyle)

    style.LittleEndian = true  <----------- weird point

    GetItemStyle me.Ref, index, style

    Return style

  #endif
End Function

the weird thing is that I had to set the LittleEndian of style to true to make it work

why this Carbon declare returns a little endian memoryblock?

There are some mistakes in my code which may have led you astray. GetItemStyle takes a *Style parameter. A Style, as defined in MacTypes.h, is an unsigned char and so should be declared as UInt8. SetItemStyle takes a StyleParameter parameter. StyleParameter is defined in MacTypes.h as Short. Apparently the reasons go back to 68k code and struct padding. I'll fix the menu code and upload a fix today. Thanks for noticing.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to