Page 8 of 35

Posted: Fri Sep 09, 2005 12:42 pm
by DoubleDutch
i see, i will try find some code that works okay on pre-xp machines, maybe someone reading this thread may also have some info.

Posted: Sat Sep 10, 2005 7:44 am
by gnozal
Library update

Small fix
- PureCOLOR_SetPopupMenuBackColor() now also works correctly with standard menus

Posted: Mon Sep 12, 2005 7:47 am
by gnozal
DoubleDutch wrote:i see, i will try find some code that works okay on pre-xp machines, maybe someone reading this thread may also have some info.
Ok, I have some code wich works well on Win9x, but not on WinNT4. As PureCOLOR_SetPopupMenuBackColor() don't work with NT4 either, I will add some owner drawn menu functions to the next library version.

Posted: Mon Sep 12, 2005 8:32 am
by Xombie
gnozal - thanks a lot for the great libraries. I was looking for a way to color individual lines in listicons but had quite a bit of trouble getting it to work correctly with callbacks. Worked but not well. Your lib saved me a lot of time :D I'm also using your purelvsort library for another project. Very nice.

Thanks!

Posted: Mon Sep 12, 2005 10:46 am
by gnozal
Xombie wrote:gnozal - thanks a lot for the great
Thanks 8)

Posted: Tue Sep 13, 2005 7:53 am
by gnozal
Library update

What's new :
- new function : PureCOLOR_SetMenuColors() ; see example below.

Code: Select all

Procedure.l WindowCallBack(WindowId.l, message.l, wParam.l, lParam.l)
  ReturnValue.l = #PB_ProcessPureBasicEvents
  ;
  ReturnValue = PureCOLOR_CallBack(WindowId, message, wParam, lParam, ReturnValue)
  ;
  ProcedureReturn ReturnValue
EndProcedure
;
If OpenWindow(0, 10, 10, 300, 200, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "Ownerdraw Menu Demo")
  SetWindowCallback(@WindowCallBack())
  If CreateMenu(0, WindowID())
    MenuTitle("Menu 1")
    MenuItem(1, "Menu item 1")
    MenuItem(2, "Menu item 2")
    MenuItem(3, "Menu item 3")
    MenuItem(4, "Exit")
    MenuTitle("Menu 2")
    MenuItem(5, "Menu item 1")
    MenuItem(6, "Menu item 2 (longer)")
    MenuItem(7, "Menu item 3")
    MenuTitle("Extra menu")
    MenuItem(8, "Extra long menu item")
    OpenSubMenu("The level 1 submenu")
    MenuItem(9, "The pure power !")
    OpenSubMenu("The level 2 submenu")
    MenuItem(10, "What ?")
    MenuItem(11, "Hello ...")
    CloseSubMenu()
    CloseSubMenu()
  EndIf
  ;
  ; MENU COLORS
  ; -------------
  ; Owner drawn :
  ; -------------
  PureCOLOR_SetMenuColors(0, #Red, RGB(200, 255, 200), #Red, RGB(100, 255, 100))
  PureCOLOR_SetWindowColor(0, RGB(200, 255, 200))
  ; -------------
  ; or not (but then only backcolor) :
  ; -------------
  ;PureCOLOR_SetPopupMenuBackColor(0, RGB(200, 255, 200))
  ; -------------
  Repeat
    event = WaitWindowEvent()
  Until event = #PB_Event_CloseWindow
EndIf
End

Posted: Tue Sep 13, 2005 4:53 pm
by RichardL
Hi,

1. Thank you for a very useful and effective library, I have used it in two projects and find that subtle colour use can be a very good way to provide emphasis.

2. I have tried the sample code in your posting of today and find that the menu text and the sub-menu arrows crash. Its OK in background colour only mode. I'm using XP Pro; fully up to date.

Regards,
Richard

Posted: Wed Sep 14, 2005 9:16 am
by gnozal
RichardL wrote:I have tried the sample code in your posting of today and find that the menu text and the sub-menu arrows crash. Its OK in background colour only mode. I'm using XP Pro; fully up to date.
Sadly I don't have XP, so I can't test it. It works well with Win98SE, and there is no text with NT4 (but no crash (missing API I think)).
- Do you use themes ?
- Do you have default system font for the menus ?

Posted: Wed Sep 14, 2005 9:20 am
by RichardL
Hi,
I just re-read my post... sorry, it was misleading! The computer / program does not crash; what I should have said is that the text and the sub-menu arrow CLASH, the arrow appears over the text and not to the right of it.

Possibly an error in determining the text length in pixels?

Richard

Posted: Wed Sep 14, 2005 9:32 am
by gnozal
RichardL wrote:Possibly an error in determining the text length in pixels?
Yes, probably. It seems to work with my defaut system font (Win98), but at this time it's not very accurate. I will try do better.
What is your menu font ?

Posted: Wed Sep 14, 2005 10:41 am
by DoubleDutch
Great addition. :)

Is it possible to add a feature to colour individual menu items?

-Anthony

Posted: Wed Sep 14, 2005 10:54 am
by RichardL
OK:

The menu font is Tahona.

Windoze XP can use XP display mode or Classic display mode.
I run my machine in classic mode and the clash problem occurs.
I just switched it to XP mode and there was NO problem.
I then switched back to Classic and there was NO clash. Strange.

I will re-boot in classic mode and report back.

Posted: Wed Sep 14, 2005 11:38 am
by RichardL
The problem has disappeared after a re-boot.

However, the first time I ran another another PB project the drop down menus were transparent... no text until I waved the mouse over them. I cannot repeat this effect.

I will report back if I can determine a stable bug.

Richard

Posted: Wed Sep 14, 2005 11:41 am
by gnozal
DoubleDutch wrote:Is it possible to add a feature to colour individual menu items?
It is possible :wink:

Posted: Wed Sep 14, 2005 12:43 pm
by DoubleDutch
Is it possible soon? :D