FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Hide / Show Image-scrollbars ( like in xBrowse ) ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Hide / Show Image-scrollbars ( like in xBrowse ) ?
Posted: Tue Feb 12, 2013 01:18 PM
Hello,

is it possible to show / hide defined Image-scrollbars
related to the Image-size ?
I tested to hide defined scrollbars from resource, but it seems not to be possible.
I check Image-size against Resource-size. As a result I want to show only the needed scrollbars.
There is just lScroll .T. or .F., not HScroll and VScroll can be defined, like in xBrowse.
I only want to show Scrollbars if Images > Resource-size.

I found oVScroll and oHScroll in class TBitmap,
also tested changing the Image-style, but the bars are still visible.

REDEFINE IMAGE oIMAGE ID 510 FILENAME NIL OF oDlg PIXEL BORDER

oIMAGE:nStyle := nOR( WS_BORDER,;
WS_CHILD, WS_VISIBLE, WS_CLIPSIBLINGS,;
WS_CLIPCHILDREN, WS_GROUP ) // , WS_TABSTOP )

oIMAGE:oHScroll := .F.
oIMAGE:oVScroll := .F.




Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 145
Joined: Wed Nov 03, 2010 09:16 AM
Re: Hide / Show Image-scrollbars ( like xBrowse ) ?
Posted: Tue Feb 12, 2013 03:06 PM
Hello

I think that this is the code.

Code (fw): Select all Collapse
#define SB_HORZ             0
#define SB_VERT             1
#define SB_CTL              2
#define SB_BOTH             3

   ShowScrollBar( ::oImage:hWnd, SB_VERT , .f. )

HB_FUNC( SHOWSCROLLBAR )
{
    hb_retl( ShowScrollBar( (HWND) hb_parnl( 1 ), hb_parni( 2 ), hb_parl( 3 ) ) );
}


http://msdn.microsoft.com/es-es/library/windows/desktop/bb787601(v=vs.85).aspx
Paco García
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Hide / Show Image-scrollbars ( like xBrowse ) ?
Posted: Tue Feb 12, 2013 04:22 PM
pgfdz ,
Thank You very much for the info,
but the defined scrollbars from resource are still visible :

( Image defined from function )
REDEFINE IMAGE oIMAGE ID 510 FILENAME NIL OF oDlg PIXEL BORDER
//SB_HORZ 0
//SB_VERT 1
//SB_CTL 2
//SB_BOTH 3
ShowScrollBar( oIMAGE:hWnd, 3 , .F. )

#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"

HB_FUNC( SHOWSCROLLBAR )
{
hb_retni( ShowScrollBar( ( HWND ) hb_parnl( 1 ), hb_parl( 2 ), hb_parl( 3 ) ) ) ;
}

#pragma ENDDUMP

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 145
Joined: Wed Nov 03, 2010 09:16 AM
Re: Hide / Show Image-scrollbars ( like in xBrowse ) ?
Posted: Tue Feb 12, 2013 08:14 PM

try it in the ON INIT.

Paco García
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Hide / Show Image-scrollbars ( like in xBrowse ) ?
Posted: Tue Feb 12, 2013 09:10 PM
ON INIT doesn't help.
I must change / adjust as a result of a defined action ( from button or TSelex ).

This sample shows a image resized to 60 %.
The hight is smaller resourceheight ( no scrollar neded )
The width is igger resource-with ( scrollbar needed )

oIMAGE:bPainted := { |hDC| ADJ_ZOOM1(oImage, hDC, cAction, oZSelect1) }

A Button :

@ 5, 475 BTNBMP oBtn[5] FILENAME c_path1 + "Original.Bmp" ;
SIZE 115, 50 OF oBar PIXEL BORDER ; // Width , Height
LEFT ;
PROMPT " &Original." ;
FONT oFont1 ;
ACTION ( oZSelect1:SetOption(9), ;
nZoom := 1, cAction := "O", oImage:Refresh() )

oImage:Refresh calls the calculation.

FUNCTION ADJ_ZOOM1(oImage, hDC, cAction, oZSelect1)
DEFINE IMAGE oImg0 FILENAME c_path1 + cZImage
oImg0:lScroll := .F. // scrollbar only disabled !!
// Size-calculations
...
oImage := FILoadImg( c_path1 + cZImage )
lAlpha := HasAlpha( oImage )
IF lAlpha = .T.
hBmp = ResizeImg( oImage, nSizeW, nSizeH )
ABPaint( hDC, 0, 0, hBmp, 255 )
DeleteObject( oImage )
ELSE
PalBmpDraw( hDC, 0, 0, oImg0:hBitmap, ,nSizeW, nSizeH )
ENDIF
DeleteObject( oImg0 )



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion