Slider question

This forum is for eXpress++ general support.
Message
Author
skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Slider question

#11 Post 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?
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slider question

#12 Post 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 ?
greetings by OHR
Jimmy

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Slipder question

#13 Post by skiman »

From a user point, it should be lbDown.
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slipder question

#14 Post by Auge_Ohr »

skiman wrote:From a user point, it should be lbDown.
how do you want to move Slider ... it need lbDown ;)
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
DXEslider4.jpg (40.24 KiB) Viewed 12324 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 725 times
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Slipder question

#15 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slipder question

#16 Post 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
DXEslider5.jpg (41.63 KiB) Viewed 12298 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 ?
Attachments
DXESLIDE5.ZIP
DLL / LIB v1.9.355
need ot4xb
(50.38 KiB) Downloaded 655 times
greetings by OHR
Jimmy

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slipder question

#17 Post 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:
DXESLIDE6.ZIP
DLL / LIB v1.9.355
need ot4xb
(51.11 KiB) Downloaded 758 times
greetings by OHR
Jimmy

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slipder question

#18 Post by Auge_Ohr »

hi,

i think "green" Sample it now about what Jack want
DXEslider9.jpg
DXEslider9.jpg (71.69 KiB) Viewed 12261 times
it use

Code: Select all

   ::NoThumb := .T.
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 722 times
greetings by OHR
Jimmy

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Slipder question

#19 Post 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)
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Slipder question

#20 Post 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.
greetings by OHR
Jimmy

Post Reply