Re: Month Calendar control: make dates bold?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi again Dan and Jonas,

Ok this turned out to be even simpler than i thought.
The trick is to set the initial dates after the control is created
and to process the notify message.

The following code was used with the WinClass library, but it can
be easily converted for any other lib.  The main idea was to simply
not set the leading month, set the present month day #1, and set
the trailing month day #2 (etc) for EVERY set of months that appear on the
calendar.  To coordinate months with the application you'll also have
to add SYSTEMTIME processing, which shouldnt be hard.


--First set initial days using the previous post's message.


atom pDSs --declared and allocated outside of notify function
pDSs=allocate(4*12)

function onNotify_MC1(atom ID,atom hWnd,atom uMsg, atom wParam, atom lParam)
  atom code,cDayState

  code=uMsg --any other lib use: NMHDR[3]

  if code=MCN_GETDAYSTATE then
    --note lParam=lpNMDAYSTATE struct
    cDayState=peek4u(lParam+28) --min number of months that need processing
    for k=0 to cDayState-1 do
      poke4(pDSs+k*4,k) --make sure enough space was allocated to handle
                        -- various cases.
    end for
    poke4(lParam+32,pDSs)--tell windows where your values are
  end if
  return 0
end function
MC:AddEvent(onNotify,MC1,routine_id("onNotify_MC1"))

--Cleanup routine:
procedure Cleanup()
  free(pDSs)
end procedure



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu