Page 2 of 5
Re: Slider question
Posted: Fri Mar 25, 2016 12:05 am
by skiman
Hi Jimmy,
I looked at your sample, and it looks and works very well. Your code is also very easy to read. It think it is rather easy to add it as an addition to Express++, so it uses the same syntax.
The original question from Jack was to have a control with TWO sliders. This way you can set a MIN and a MAX on one slider bar. I saw that you can set some 'scope' with min and max, but is it possible to adjust it by the user?
Re: Slider question
Posted: Fri Mar 25, 2016 3:07 am
by Auge_Ohr
skiman wrote:The original question from Jack was to have a control with TWO sliders. This way you can set a MIN and a MAX on one slider bar. I saw that you can set some 'scope' with min and max, but is it possible to adjust it by the user?
this was my Question which Action to use ?
press a Key ( F_xx ) and open a Input Window ?
o:LbDown seems me wrong while used internal so i think better using o:RbDown ?
Re: Slipder question
Posted: Fri Mar 25, 2016 7:37 am
by skiman
From a user point, it should be lbDown.
Re: Slipder question
Posted: Fri Mar 25, 2016 11:03 pm
by Auge_Ohr
skiman wrote:From a user point, it should be lbDown.
how do you want to move Slider ... it need lbDown
![Wink ;)](./images/smilies/icon/wink.gif)
yes ... it is possible but need more Code to find out what User mean.
so i have activate RbDown / RbUp to move Tick Marker "on-fly"
![DXEslider4.jpg](./download/file.php?id=996&sid=cec3cb8588ce412e736b37692214ecb6)
- DXEslider4.jpg (40.24 KiB) Viewed 12884 times
Problem : i got Slider Position as Tick (o:Range). now need to calculate relative Position in Pixel.
i have test it with LANDSCAPE, PORTRAIT still under Construction.
i include Codeblock Slot "bPos2Pixel" and "Per2Pixel" so you can make your own Code for calculation.
---
i have try to activate Ownerdraw as known from Xbase++ but i did not find a API Constant for it
Code: Select all
#define LVS_OWNERDRAWFIXED 0x0400
#define SBT_OWNERDRAW 0x1000
#define TCS_OWNERDRAWFIXED 0x2000
#define HDF_OWNERDRAW 0x8000
#define LBS_OWNERDRAWFIXED 0x0010
#define LBS_OWNERDRAWVARIABLE 0x0020
#define CBS_OWNERDRAWFIXED 0x0010
#define CBS_OWNERDRAWVARIABLE 0x0020
#define MF_OWNERDRAW 0x00000100
#define MFT_OWNERDRAW MF_OWNERDRAW
#define BS_OWNERDRAW 0x0000000B
#define SS_OWNERDRAW 0x0000000D
but none of them seem to fit TRACKBAR_CLASS ? all Sample which i found work with Customdraw.
here latest DLL / LIB and Demo Source, look at READ.ME
- DXESLIDE4.ZIP
- DLL / LIB v1.9.355
need ot4xb - (47.98 KiB) Downloaded 798 times
Re: Slipder question
Posted: Sun Mar 27, 2016 10:07 am
by rdonnay
It think it is rather easy to add it as an addition to Express++, so it uses the same syntax.
Anything like this
CAN be added to eXpress++ but I
will not do this anymore. I made that mistake with MXPUSHBUTTONS and it was eventually not supported. I replaced that with a much better solution: DCPUSHBUTTONXP.
What I
WILL DO is make it easier to add your own custom objects like this. I will write a sample program to show how to do this. This can be done now with @ .. DCCUSTOM, but it limits your syntax.
I was nearly done with a slider sample that is written in eXpress++, but now I think I will go in a different direction and make it easier to use Jimmy's solution because it is much more robust.
Re: Slipder question
Posted: Sun Mar 27, 2016 12:51 pm
by Auge_Ohr
hi,
this native Trackbar Control does not exist in Xbase++ so it is different to MXPUSHBUTTONS.
we also do not have Listview or Rebar. other like DatePick or MonthDay need activeX if not using native Control.
to avoid activeX i start those native Control and DXD Lib.
---
New v5
visual Style :
i have add visual Style for TBCD_CHANNEL when using Customdraw Color
now it is smaller and fit into visual Style Retangle
![DXEslider5.jpg](./download/file.php?id=999&sid=cec3cb8588ce412e736b37692214ecb6)
- DXEslider5.jpg (41.63 KiB) Viewed 12858 times
i also add visual Style for TBCD_TICS ... nothing happend ... hm
i try to change "Hot" Color of TBCD_THUMB this Way
Code: Select all
IF nState = CDIS_FOCUS .OR. nState = nOR(CDIS_FOCUS,CDIS_SELECTED)
@GDI32:SelectObject(hdc,::HiBackColor)
ELSE
@GDI32:SelectObject(hdc,::ClrTHUMB )
ENDIF
but Eclipse does not change COlor ...
same happend when using visual Style Parts ( now possible, see Picture )
i can display right Style Parts but it seem not to react on uItemState ... hm
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
so i still got no "Hot" State to react on it
Question : what about Icon or Bitmap for Slider Thumb ?
do we need it (now) or is native Trackbar Control good enough to release Source now ?
Re: Slipder question
Posted: Sun Mar 27, 2016 11:34 pm
by Auge_Ohr
Control Style (-> iVar) must set before o:Create(), Methode work after o:Create()
iVar
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Code: Select all
// set TBS_ Constante
//
VAR Autoticks -> TBS_AUTOTICKS Default .T. // default
VAR NoTicks -> TBS_NOTICKS Default .F. // no Ticks
VAR PosBoth -> TBS_BOTH Default .F. // Ticks on both Side
VAR PosTop -> TBS_TOP Default .F. // need TBS_HORZ (LANDSCAPE)
VAR PosBottom -> TBS_BOTTOM Default .T. // need TBS_HORZ (LANDSCAPE)
VAR PosLeft -> TBS_LEFT Default .F. // need TBS_VERT (PORTRAIT)
VAR PosRight -> TBS_RIGHT Default .T. // need TBS_VERT (PORTRAIT)
VAR SelRange -> TBS_ENABLESELRANGE Default .T. // need to SetScope()
VAR Fixedlength -> TBS_FIXEDLENGTH Default .F. // need to change Thumbs Size
VAR NoThumb -> TBS_NOTHUMB Default .F. // no Thumbs
VAR Tooltips -> TBS_TOOLTIPS Default .T. // show Tooltip (when press Thumb)
VAR Reversed -> TBS_REVERSED Default .F. // Flag only ?
VAR DownIsLeft -> TBS_DOWNISLEFT Default .T. // hm ... ?
VAR BeforeMove -> TBS_NOTIFYBEFOREMOVE Default .F. // since Vista, under Construction
VAR TransBkGnd -> TBS_TRANSPARENTBKGND Default .F. // since Vista, under Construction
// NEED Customdraw
//
VAR PaintStyle -> "ECIPILS" / "RETANGLE" / "VISUAL" -> Default
METHOD
Code: Select all
SetThumblength(nValue) -> set Size of TBCD_THUMB -> TBCD_CHANNEL wide
NEED : Fixedlength := .T. and Customdraw
SetPageSize(nValue) -> Sets the number of logical positions the trackbar's slider moves
in response to keyboard input, such as the or keys, or mouse input,
such as clicks in the trackbar's channel
SetLineSize(nValue) -> Sets the number of logical positions the trackbar's slider moves
in response to keyboard input from the arrow keys, such as the or keys.
* -------- fixed Code -------- *
visual Style
Code: Select all
IF lAnd( nState, nOR(CDIS_FOCUS,CDIS_SELECTED))
@GDI32:SelectObject(hdc,::HiBackColor)
ELSE
@GDI32:SelectObject(hdc,::ClrTHUMB )
ENDIF
now will work when Select/Press Thumb
* ------ known Problem ------- *
still got no "HOT" visual Style ... hm ...
![Think :think:](./images/smilies/eusa/think.gif)
- DXESLIDE6.ZIP
- DLL / LIB v1.9.355
need ot4xb - (51.11 KiB) Downloaded 827 times
Re: Slipder question
Posted: Thu Mar 31, 2016 5:58 pm
by Auge_Ohr
hi,
i think "green" Sample it now about what Jack want
![DXEslider9.jpg](./download/file.php?id=1002&sid=cec3cb8588ce412e736b37692214ecb6)
- DXEslider9.jpg (71.69 KiB) Viewed 12821 times
it use
so no Thumb is used and Marker will display in Trackbar Channel.
as you can see Marker / Thumbs can now be a Image (ICO,BMP)
i include Gradient for Trackbar Channel ( when no Scope used )
also Control Background Color can be changed ( do not ask me for Gradient here ... )
have fun
- DXESLIDE9.ZIP
- DLL / LIB v1.9.355
- (75.58 KiB) Downloaded 748 times
Re: Slipder question
Posted: Thu Mar 31, 2016 11:54 pm
by skiman
Hi,
I got this error when running dxeslide.
Code: Select all
oError:args :
-> VALTYPE: A VALUE: {"USER32", "InvalidateRect"}
-> VALTYPE: U VALUE: NIL
-> VALTYPE: N VALUE: 1
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : NIL
oError:description : Internal data structures corrupted
oError:filename :
oError:genCode : 41
oError:operation : NFPCALL
oError:osCode : 0
oError:severity : 2
oError:subCode : 5
oError:subSystem : BASE
oError:thread : 1
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from DXE_SLIDER:_SETNEWHFONT(1891)
Called from DXE_SLIDER:_PRESPARA(1817)
Called from DXE_SLIDER:CREATE(2121)
Called from MAIN(78)
Re: Slipder question
Posted: Fri Apr 01, 2016 1:20 am
by Auge_Ohr
skiman wrote:I got this error when running dxeslide.
Code: Select all
-> VALTYPE: A VALUE: {"USER32", "InvalidateRect"}
Called from DXE_SLIDER:_SETNEWHFONT(1891)
Called from DXE_SLIDER:_PRESPARA(1817)
Called from DXE_SLIDER:CREATE(2121)
Called from MAIN(78)
hm ... please try without Font in Presentation Parameter for DXESLIDER() Control. i will check it.