Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


CE Calendar and Get Date Time

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater
Reputation: 23

Joined: 10 Apr 2015
Posts: 812

PostPosted: Tue May 14, 2019 10:04 am    Post subject: CE Calendar and Get Date Time Reply with quote

Hi, since TCalendar does not show on form designer (I am using CE 6.8.3), then:

-- creating a class for calendar

Code:
function createCalendarDialog(Parent)
local cal = createComponentClass('TCalendar', Parent)
 cal.Parent = Parent
 return cal
end

f = createForm()
calen = createCalendarDialog(f)
calen.IsSelectedDate = true


How I select a single specific date by click event on the calendar?.

I saw on CE calendar.pas

Code:
function calendar_getDate(L: PLua_State): integer; cdecl;
var
  cal: TCalendar;
  s: string;
begin
  cal:=luaclass_getClassObject(L);
  DateTimeToString(s,'yyyy-mm-dd',cal.DateTime);
  lua_pushstring(L, AnsiToUtf8(s) );
  result:=1;
end;


How re-write this on CE Lua, when DateTimeToString() not defined yet?
Aby chance to have TCalendarDialog on CE?

Regards.

EDIT: SOLVED

Code:
function createCalendar(Parent)
local cal = createComponentClass('TCalendar', Parent)
 cal.Parent = Parent
 return cal
end

f = createForm()
f.width = 348
calen = createCalendar(f)
calen.left=2
calen.IsSelectedDate = true
lbl = createLabel(f)
lbl.left = 10
lbl.top = 200


function get_date()
 lbl.caption = calen.Date
 print(calen.DateTime)
end

f.Show()

calen.onChange = get_date

_________________
Singapore Sling + Johnnie Walker + Some Peanuts....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites