does Fivewin have a Gradient ComboBox ?

does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Sun Feb 12, 2023 2:00 pm

hi,

while i can use Menu with Gradient i like to ask if Fivewin have Combobox with Gradient :?:

i can change Foreground and Background Color into Dark-Mode but Highlight Bar ( COLOR_HIGHLIGHT ) have normal Color

btw. does Fivewin have a "Ownerdraw" Sample :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: does Fivewin have a Gradient ComboBox ?

Postby Antonio Linares » Mon Feb 13, 2023 7:52 am

Dear Jimmy,

Please review FWH\samples\ownerdra.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Tue Feb 14, 2023 4:08 am

hi Antonio,
Antonio Linares wrote:Please review FWH\samples\ownerdra.prg

aaah, i have to look into *.RC File too when search for Constant as "Keyword"
i´m not aware about Technique using "REDEFINE" ... is there a Readme for "Dummy" ?

---

bOwnerDraw -> Combobox
bDrawItem -> Listbox / Combobox (CodeBlock to evaluate to select a ownerdraw bitmap to paint)

Code: Select all  Expand view
METHOD DrawItem( nIdCtl, nPStruct ) CLASS TComboBox
   ...
      uVal  := LbxDrawItem( nPStruct, ::aBitmaps, ::aItems, ::nBmpWidth, ::bDrawItem )
   else
      uVal  := Eval( ::bOwnerDraw, Self, nIdCtl, TDrawItemStruct():New( nPStruct ), nPStruct )

but how does ::bOwnerDraw, look like :?:

can i pass my "own" Method and use API Function to "paint" into TDrawItemStruct():hDC :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Wed Feb 15, 2023 6:33 am

hi,

have try ComboBox Ownerdraw and "fill" bOwnerDraw with Codeblock

Code: Select all  Expand view
     oCombo_left:bOwnerDraw := {|a,b,c,d| DoMyComBo(a,b,c,d) }


Code: Select all  Expand view
FUNCTION DoMyComBo()

   nCount := PCOUNT()
   FOR ii := 1 TO nCount
      xPara := PValue(ii)
      DO CASE
         CASE ii = 1 ; oSelf    := xPara
         CASE ii = 2 ; nIdCtl   := xPara
         CASE ii = 3 ; aStruc   := xPara
         CASE ii = 4 ; nPointer := xPara
      ENDCASE
   NEXT
   fwlog "DoMyComBo()",nCount, IF(VALTYPE(oSelf) = "O","Object",oSelf) , nIdCtl , VAR2CHAR( aStruc ), nPointer

RETURN 0


Parameter a,b,c,d between "Pipe" (|) come from
Code: Select all  Expand view
      uVal  := Eval( ::bOwnerDraw, Self, nIdCtl, TDrawItemStruct():New( nPStruct ), nPStruct )


Result
"DoMyComBo()" = "DoMyComBo()"

nCount = 4

IF(VALTYPE(oSelf) = "O","Object",oSelf) = "Object"

nIdCtl = 109

VAR2CHAR( aStruc ) = "__itemSetObj( {{CTLTYPE, 3}, {CTLID, 109}, {ITEMID, 0}, {ITEMACTION, 1}, {ITEMSTATE, 4096}, {HWNDITEM, 1770774}, {HDC, 1157698194}, {ARECT, {3, 3, 35, 70}}, {ITEMDATA, `ęƒ}}, {{TDRAWITEMSTRUCT,}} )"

nPointer = 1373540

it seems to have what is need for Ownerdraw ComboBox ... now work can begin
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Wed Feb 15, 2023 11:06 am

hi,

got 1st Result
Image

but Cursor Highlight does only work when Mouse is over Listbox-Part of Combobox

Code: Select all  Expand view
  CASE itemAction = ODA_SELECT
   CASE itemAction = ODA_DRAWENTIRE
   CASE itemAction = ODA_FOCUS

it does work on ODA_FOCUS to Highlight Item
but when Highlight on ODA_SELECT than "all" Item will be Highlight when move Mouse ... hm
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: does Fivewin have a Gradient ComboBox ?

Postby Antonio Linares » Wed Feb 15, 2023 11:33 am

Dear Jimmy,

You are doing an outstanding work on your total commander version, congratulations

Where could we download it from to test it ?

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Wed Feb 15, 2023 2:02 pm

hi Antonio,
Antonio Linares wrote:Where could we download it from to test it ?

i´m going to prepare next Release
but still have new Idea ... so i must clean-up again ...

i have now include System Icon from "\System32\imageres.dll" for Ownerdraaw Combobox
Code: Select all  Expand view
     cDLL := WinDir + "\System32\imageres.dll"

      DO CASE
         CASE acType[ itemID + 1 ] = DRIVE_UNKNOWN
            nResID := 75
         CASE acType[ itemID + 1 ] = DRIVE_NO_ROOT_DIR
            nResID := 32

         CASE acType[ itemID + 1 ] = DRIVE_REMOVABLE
            IF SUBSTR( acItem[ itemID + 1 ], 1, 1 ) $ "AB"
               nResID := 23
            ELSE
               cDLL := WinDir + "\System32\DDORes.dll"
               nResID := 2389
            ENDIF

         CASE acType[ itemID + 1 ] = DRIVE_FIXED
            IF SUBSTR( acItem[ itemID + 1 ], 1, 2 ) = "C:"
               nResID := 36
            ELSE
               nResID := 32
            ENDIF
         CASE acType[ itemID + 1 ] = DRIVE_REMOTE
            nResID := 33
         CASE acType[ itemID + 1 ] = DRIVE_CDROM
            nResID := 30
         CASE acType[ itemID + 1 ] = DRIVE_RAMDISK
            nResID := 34

      ENDCASE

      hModule := GetModuleHandle( cDLL )
      IF hModule == 0
         hModule := LoadLibrary( cDLL )
      ENDIF
      nIcoHandle := LOADIMAGERESICON( hModule, nResID, 32 )

      DrawIconEx( hDC, ;
                  nTop, ;
                  nLeft, ;
                  nIcoHandle, ;
                  nSize, ;
                  nSize, ;
                  0, ;                // _In_     UINT   istepIfAniCur,
                  0, ;                // _In_opt_ HBRUSH hbrFlickerFreeDraw,
                  nOr( DI_NORMAL ) )  // _In_     UINT   diFlags

      DestroyIcon( nIcoHandle )
      FreeLibrary( hModule )

now i must not provide Icon in *.RC
Image
p.s. This Image show NO Highlight Bar as Mouse is not "over" Listbox-Part of Combobox ... something is missing ... hm
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: does Fivewin have a Gradient ComboBox ?

Postby Jimmy » Sat Feb 18, 2023 8:54 am

hi,

now Combobox look like Menu
Image
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1584
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests