FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnGet & FWH 9.06
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
BtnGet & FWH 9.06
Posted: Thu Jul 23, 2009 08:20 AM
2 button appears in my get. How do I get rid/hide the small one? I already tried placing btnget.ch before and after fivewin.ch but it didn't help



TIA
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: BtnGet & FWH 9.06
Posted: Fri Jul 24, 2009 06:41 AM
Dear Hua,

I think the original GET..ACTION is work as BTNGET.

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15105&hilit=+btnget

Regards,
Dutch
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: BtnGet & FWH 9.06
Posted: Wed Jul 29, 2009 04:17 AM
There's a couple of things different between GET..ACTION and BTNGET. With BTNGET, I can assign the color for the get field with focus and F2 will invoke :bAction with no additional coding on my part.

However the showstopper for me is I use a version of Shuming's AutoResize() to resize my controls depending on screen resolution and with GET..ACTION it simply doesn't work. You could see this in the image above. It works fine all this while with BTNGET.

I may have to modify AutoResize() to acommodate GET..ACTION but I dont know how. This is the version of AutoResize() that I use.

Code (fw): Select all Collapse
function AutoResize(nTop,nLeft, oDlg, oFold)
  local i,nRatioX,nRatioY, nLen := len(oDlg:aControls), oCtrl, aRect
  local cClass, aRes_

  default nTop  := 0
  default nLeft := 0

  aRes_ := ClosestRes(GetSysMetrics(SM_CYSCREEN))
  nRatioX := aRes_[1]/800 //GetSysmetrics(0)
  if nRatioX <= 1
     //<=800*600, not needed
     return nil
  end
  nRatioY := aRes_[2]/600 //GetSysmetrics(1)
  for i := 1 to nLen
    oCtrl = oDlg:aControls[i]
    cClass := oCtrl:classname()
    aRect = GetCoors( oCtrl:hWnd )
    if cClass == "TCOMBOBOX"
       oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY)
    elseif cClass $  "TWBROSE,TCBROWSE,TSBROWSE"
        aeval(oCtrl:aColSizes, {|val, pos| oCtrl:aColSizes[pos] *= nRatioX })
        oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY, (aRect[4] - aRect[2])*nRatioX, (aRect[3] - aRect[1])*nRatioY, .t. )
    else
       oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY, (aRect[4] - aRect[2])*nRatioX, (aRect[3] - aRect[1])*nRatioY, .t. )
       if cClass == "TFOLDER"
          aeval(oCtrl:aDialogs, {|oTDlg| Autoresize(oCtrl:nFdHeight-1,1, oTDlg, oCtrl)})
       endif
    endif
  next

  aRect = GetWndRect( oDlg:hWnd )

  oDlg:Move( nTop,nLeft,oDlg:nWidth*nRatioX, oDlg:nHeight*nRatioY, .T. )
  if !empty(oFold)
     oDlg:SetSize(oFold:nWidth()-5, oFold:nHeight()-oFold:nFdHeight-4)
  endif

  if oDlg:lCentered
     WndCenter( oDlg:hWnd )
  else
     if Empty( oDlg:cResName )
        oDlg:Move( oDlg:nTop, oDlg:nLeft )
     endif
  endif

return nil
//-----------------------------------------------------------------------------------------
function ClosestRes(nHgt)
// find a value that can maintain the ratio 800:600 (4:3), so the screen
// won't look too odd on a widescreen monitor
local x, nWid
do while nHgt % 3 != 0
   nHgt--
enddo
x := nHgt/3
nWid := x*4
return {nWid, nHgt}
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: BtnGet &amp; FWH 9.06
Posted: Wed Jul 29, 2009 06:18 AM

Dear Hua,

I'm sorry, I never use AutoResize().

Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion