BtnGet & FWH 9.06

BtnGet & FWH 9.06

Postby hua » Thu Jul 23, 2009 8: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

Image

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: BtnGet & FWH 9.06

Postby dutch » Fri Jul 24, 2009 6: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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: BtnGet & FWH 9.06

Postby hua » Wed Jul 29, 2009 4: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: Select all  Expand view

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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: BtnGet & FWH 9.06

Postby dutch » Wed Jul 29, 2009 6:18 am

Dear Hua,

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

Dutch
Regards,
Dutch

FWH 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests