work with Debugger or MsgInfo() but not without ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

work with Debugger or MsgInfo() but not without ?

Post by AUGE_OHR »

hi,

i have a "selfmade" HB_FUNC( PAINTTAB ) in HBFM since v0.038

it is to Color Tab-Control Background and it work when have more than 1 TAB
Paint_Tab.JPG
Paint_Tab.JPG (21.91 KiB) Viewed 1449 times
when have only 1 TAB it fail :shock: ... but work when using Debugger or MsgInfo() :?

Code: Select all

STATIC FUNCTION Paint_Tab_Window( nNo )
LOCAL hWnd, i, iMax
LOCAL nOffSet := 0
LOCAL nheight := 0
LOCAL aRect

   IF nNo = 1
      hWnd := WinLeft.Tab_Left.handle
      iMax := LEN( Stack_Left )
   ELSE
      hWnd := WinRight.Tab_Right.handle
      iMax := LEN( Stack_Right )
   ENDIF
   FOR i := 1 TO iMax
      aRect := TABCTRL_GETITEMRECT( hWnd, i-1 )
      nOffSet += aRect[ 3 ] - aRect[ 1 ]
      nheight := aRect[ 4 ] - aRect[ 2 ]
   NEXT
   IF iMax = 1
       msginfo(VAR2CHAR(nOffSet))
   ENDIF
   PAINTTAB( hWnd, SP_nColor1(), nOffSet, nheight )
RETURN NIL
i have check nOffSet and Value is OK

include HB_FUNC( PAINTTAB ) and some Demo Code ( NOT full working Demo :!: )
PTAB.ZIP
(1.02 KiB) Downloaded 151 times
who have a Idea why it does not work when have only 1 x TAB :idea:
have fun
Jimmy
Red2
Posts: 273
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: work with Debugger or MsgInfo() but not without ?

Post by Red2 »

Hi Jimmy,

I am investigating Tab-Control background coloring in HMG. This is something available in Visual FoxPro that I miss in HMG.

Your interesting earlier post (https://hmgforum.com/viewtopic.php?f=5&t=6336) suggests that you did successfully implemented this in the Xbase++ product.

You state very clearly that the code in PTAB.ZIP is not a working Demo. My attempts to adapt this (incomplete) code into HMG for a two page Tab-Control have, unfortunately, been unsuccessful. (Errors!)

My Question:
Have you (or has anyone) successfully implemented dynamic background tab coloring for a two page Tab-Control in HMG? Although a Demo sample would be ideal any guidance would be greatly appreciated.

Thank you in advance.
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: work with Debugger or MsgInfo() but not without ?

Post by AUGE_OHR »

hi,

have a look at https://github.com/AugeOhr/HBFM

this is the full Project Source Code for HMG.

if you have more Question please open a new Thread
have fun
Jimmy
Red2
Posts: 273
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: work with Debugger or MsgInfo() but not without ?

Post by Red2 »

Hi Jimmy,

Thank you for your prompt reply. I will look in there for your Tab-Control background coloring code.

Kind regards,
Red2
Post Reply