May 04, 2024, 09:37:03 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Recent posts

Pages 1 ... 5 6 7 8 9 10
61
General Questions / Re: Time Picker
Last post by LarryMc - December 25, 2023, 06:35:38 AM
I think you are going to have to send the control the DTM_SETMCCOLOR message with wparam set to MCSC_MONTHBK and lparam set to the color of the background you want.
And then send the control the DTM_SETMCCOLOR message with wparam set to MCSC_TEXT  and lparam set to the color of the text you want.

That's my best guess.

62
General Questions / Re: Time Picker
Last post by Brian - December 25, 2023, 06:14:41 AM
Managed to get the font to change, but no joy with colouring the Time Picker

Brian
63
General Questions / Re: Time Picker
Last post by Egil - December 24, 2023, 01:47:13 PM
Hi Brian,

I have always used SETFONT for changing fonts and SETWINDOWCOLOR, FRONTPEN and BACKPEN as needed to maniputlate the colors.
But presently not able to load anything into IWB here, so unable to test these statements with your code.

Good luck,
Egil.

Almost forgot.... HAPPY CHRISTMAS!
64
General Questions / Time Picker
Last post by Brian - December 24, 2023, 09:04:36 AM
Hi,

I want to change the font in this Time Picker to Verdana, 10 point, and also change the background colour. Any ideas, anyone?

Brian
65
General Questions / Re: Date Routine
Last post by Brian - November 24, 2023, 08:19:08 AM
Bill's code is the business - works great for me. I will post my program in a few days when I think I have done with it. Probably not useful to anyone else, but there are some good features in it

Brian
66
General Questions / Re: Date Routine
Last post by Egil - November 22, 2023, 09:55:57 AM
Quote from: Brian on November 22, 2023, 08:09:25 AMgil: Couldn't convert your code to IWB - my brain wasn't in gear

And IWB does not work for me at the moment.
This kind of output formatting is one of the very few major differences between IWB and CB.
I may have an EB version of the same code, but then it is on a backup disk back home.
But think Bill's code is just right for you.


Good Luck to both of you.
Egil
67
General Questions / Re: Date Routine
Last post by Brian - November 22, 2023, 08:09:25 AM
Thanks, Chaps,

Nice to know somebody is alive and kicking on this forum!

Egil: Couldn't convert your code to IWB - my brain wasn't in gear
Bill: Your code was very similar to my solution that I posted

Thanks again,

Brian
68
General Questions / Re: Date Routine
Last post by billhsln - November 21, 2023, 09:56:24 PM
Not sure who wrote this, but it will do date math.  I am just using it to calculate tomorrow.

$INCLUDE "windowssdk.inc"
AUTODEFINE "off"

DEF wdate:STRING

wdate=DATE$("yyyy-MM-dd")
wdate=datemath(wdate,1)

END

SUB DateMath(id:STRING,diff:INT),STRING
'======================================
DEF yyyy,mm,dd:INT
TYPE DateType
UINT LowDW
UINT HighDW
ENDTYPE

UNION uDT
UINT64 qVar
DateType dtVar
ENDUNION

SYSTEMTIME st
FILETIME ft
uDT u
INT rtn
'First get the system time so that all the other structure members are filled
GetSystemTime(st)
'Set up the SYSTEMTIME structure with the original date like so:
st.wYear=VAL(MID$(id,1,4))
st.wMonth=VAL(MID$(id,6,2))
st.wDay=VAL(MID$(id,9,2))
'Convert the system time to filetime
rtn=SystemTimeToFileTime(st,ft)
'Move the FILETIME info into a UINT64 variable
'and add days using the Quad variable (this is how M$ recommends doing it)
u.dtVar.LowDW=ft.dwLowDateTime
u.dtVar.HighDW=ft.dwHighDateTime
'Add days using the Quad variable - 1 day in nano seconds 24 * 60 * 60 * 10000000
u.qVar+=((24*60*60*10000000)*diff) ' <---- diff days
ft.dwLowDateTime=u.dtVar.LowDW
ft.dwHighDateTime=u.dtVar.HighDW
'Convert the file time to system time
rtn=FileTimeToSystemTime(ft,st)
'Now your new date will be in the SYSTEMTIME structure members
yyyy=st.wYear
mm=st.wMonth
dd=st.wDay
RETURN USING("0####&0##&0##",yyyy,"-",mm,"-",dd)
ENDSUB

Bill
69
General Questions / Re: Date Routine
Last post by Egil - November 21, 2023, 07:21:05 AM
Brian,

I did something similar several years ago and converted it into CB.
Here is the CB code. and don't think you should have any problems to convert it to IWB and formatting the output in whatever way you like.
Thing are much more relaxed in CB when you want to format output, but don't think you should have any problems to convert it to IWB and formatting the output in whatever way you like.

Good Luck!
Egil
70
General Questions / Re: Date Routine
Last post by Brian - November 21, 2023, 06:25:41 AM
Had another think about it!

Brian
Pages 1 ... 5 6 7 8 9 10