April 25, 2024, 07:36:38 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Recent posts

Pages 1 ... 5 6 7 8 9 10
61
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!
62
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
63
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
64
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
65
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
66
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
67
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
68
General Questions / Re: Date Routine
Last post by Brian - November 21, 2023, 06:25:41 AM
Had another think about it!

Brian
69
General Questions / Date Routine
Last post by Brian - November 21, 2023, 04:59:22 AM
Help! This code works, and adds one day onto the current day, whatever it is

What I want it to do is put the result of this line: PRINT USING("##/##/####",st.wDay,st.wMonth,st.wYear)
into a STRING variable, like 'tomorrow' and include the leading zeros if a day is like '1' or a month is like '5', for example

Any ideas? Compile as a Console...

Brian
70
General Questions / Re: Change coloron LV headers?
Last post by Egil - November 16, 2023, 03:51:23 PM
Hi,
Unfortunately back in Trondheim. This time by bus, as driving a car for about four hours when on a pain killer "diet" never has been a good idea. This means that I have a lot of spare time to kill....

And since I'm not quite satisfied whith this LV color project, I've been searching the web for ideas on how to do things a little more "streamlined"than the ideas posted here by other members.
 
I found this page(for C/C++ coding) very interesting:
( https://www.codeproject.com/Articles/24114/Adding-Color-to-Listview-with-Customdraw )

I beleive there should be enough information in that project to make custom made routines for IWB and/or CB. Wouldn't that be nice?
I work rather slow at the moment, so if others would like to try, I don't mind.

Regards,
Egil.

Pages 1 ... 5 6 7 8 9 10