yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] poyensa:
The greater the effort the greater the glory :)

It is terrible that it took me the whole day to realize this mistake ...

You probably know, but it use to happend to all of us, everyday. But all that work is not wasted, you will probably have found many usefull things for the future. Everything requires its time .... Enjoy the journey :)
[Windows Mobile Software Development] meltwater:
Yep, this is the problem with sense, lots of resets and scratching of heads until you find that typo or try yet another way to do it.

I've spent hours/days working on something and getting no where, but then come back another day and did it in a few min.
[Windows Mobile Software Development] RoryB:
Thank you both for the encouragement.

It worked well last night. So now, I'll save a back up of this working version and start trying the next things.
[Windows Mobile Software Development] Dunc001:
Have you got anything new for us to look forward to yet Meltwater? Facebook widget, new rss widget maybe... ;)
[Windows Mobile Software Development] meltwater:
Well aside from the VolDPad switch which is finished no unfortunately not.

The full-fat versions of the tabs are keeping me busy at the moment, trying to jam some new features in. :D
[Windows Mobile Software Development] RoryB:
I have this working

Handle_Reminder1 = function()
-- 0 = HKLM
-- 2 = HKCU
x = MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPT") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPTALLDAY") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "TASK") + 1
if x == 1 then
CHTWReminder1_Text1.String = "No Active" .. "\n" .. "Reminders" .. "\n" .. "at this Time"
else
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1.mscr")
end
end

Handle_Reminder1()

Handle_Reminder1_Timer = timer(1) -- time in seconds
Handle_Reminder1_Timer:Stop()
Handle_Reminder1_Timer.OnElapsed:connect(Handle_Reminder1)
Handle_Reminder1_Timer:Start()

Made an adjustment to get the registry to update to no reminders.

Handle_Reminder1 = function()
-- 0 = HKLM
-- 2 = HKCU
x = MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPT") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPTALLDAY") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "TASK") + 1
if x == 1 then
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder1.Text", "No Active")
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder2.Text", "Reminders")
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder3.Text", "at this Time")
else
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1.mscr")
end
end

Now to figure out how to read string values outside the manila registry and I will not need the script.
[Windows Mobile Software Development] RoryB:
Another update to not have the script run unless there is actually a change in the reminder.

Handle_Reminder1 = function()
-- 0 = HKLM
-- 2 = HKCU
x = MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPT") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPTALLDAY") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "TASK") + 1
if x == 1 then
y = GetCHTSettingString("Reminder1.Text")
if y ~= "No Active" then
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder1.Text", "No Active")
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder2.Text", "Reminders")
_application.Store:SetStringValue(Lifetime_Permanent, "CHT.Reminder3.Text", "at this Time")
end
else
if x ~= x1 then
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1.mscr")
end
end
x1 = MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPT") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPTALLDAY") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "TASK") + 1
end

Also, in the xmu I set it to give me the current settings instead of a default value.

<text rgb='0,0,0' label='color in RGB code as in 0,0,0 is black' />
<edit id='%REMINDER1COLOR%' label='reg:HKCU\Software\HTC\Manila\CHT.Reminder1.Color'/>
<text rgb='0,0,0' label='Font size as in 12' />
<edit id='%REMINDER1FONTSIZE%' label='reg:HKCU\Software\HTC\Manila\CHT.Reminder1.FontSize'/>
[Windows Mobile Software Development] poyensa:
a bit of CHTS

comming from here

CHTSchduler is a great program, you probably know. When you find a nice layout for your home screen you can save it, then try to find another layout and save it again, and easily change from one to other in one click or in a scheduler base[*], thats fantastic! If your widget is part of that nice layout would be agood idea integrate it in CHTS. Its is not really difficult, just you have to say to CHTS program what the files make your widget, so it will be saved together with the rest of the layout.

So we do need to create our files CHTWidget_CHTWNotes1.xml & CHTReg_CHTWNotes1.txt, initially will be in \CHTS folder of the kitchen , then automatically will be deployed to the device if DevMode, or deployed to \cab\_final_files if we run _generate_files_for_cab.bat. This 2 files must be set to be copied to \windows folder in the installation process of the cab

As usual we are working on an existing file as example, and adapting to our widget. The CHTWidget_CHTWNotes1.xml file has to contain a list if the files used in the widget, just go to \cab\_final_files and there you find them. The CHTReg_CHTWNotes1.reg has to include the registry keys used by our widget, in this case all of them for the menu setting in HKCU\Software\HTC\Manila\CHT.Notes1.*

CHTS will save that files and registry values included in the list together with the rest of the saved layout. Isnt genial? I feel myself like never say enough thanks to MichelDiamond for his nice work. Thanks again!

[*] CHTScheduler has many many manu more features, you can know more directly in the CHTScheduler thread
[Windows Mobile Software Development] RoryB:
I did not have to require anything. I guess musichelper is a base function in sense lua.

The values APPT, APPTALLDAY and TASK do not exist if there are no items instead of being 0x00000000. They are all DWord values so I am able to get them with musichelper.

I will try the valuechangedevent just to see if it works. Thank you for the idea.

The value I really want is "active" under HKLM, "System\\State\\Shell\\Reminders", "Active") which is a string. It too does not exist if there are no active reminders, but is the name of another registry key that does not exist until there is an active reminder. This key has the appointment information in a few values under that key.

Another thing I found interesting is that RUNPROGRAM did not work in the if statement, but Shell_NavigateTo did. I think Shell_NavigateTo is a base function and I saw RUNPROGRAM getting defined in one of the common or core lua files.
[Windows Mobile Software Development] Dunc001:
OK, so if (HKLM, "System\\State\\Shell\\Reminders", "Active") as a string gives you another reg key when active you could try something like:

GetAppointment = function()

local x = MusicHelper_GetStringValue(0, "System\\State\\Shell\\Reminders", "Active")

local y = ""

if x ~= "" then

y = MusicHelper_GetStringValue(0, x)

Appointment.String = tostring(y)

else

Appointment.String = "No Appontments"

end

end

GetAppointment()

That way if the first key is empty you return "No Appointments", but if the first key contains a string value giving the second key then y collects that. Might work?
[Windows Mobile Software Development] RoryB:
MusicHelper_GetValueChangedEvent(0, "System\\State\\Reminder\\Count", "APPT"):connect(Handle_Reminder1) breaks the widget. Actually no widgets show up.

GetAppointment = function()

local x1 = MusicHelper_GetStringValue(0, "System\\State\\Shell\\Reminders", "Active")
local y1 = ""

if x1 ~= "" then
y1 = MusicHelper_GetStringValue(0, x1)
Appointment.String = tostring(y1)
else
Appointment.String = "No Appointments"
end
end

GetAppointment()

Breaks the widgets too without it even being called to run.

Is there a MusicHelper_GetStringValue function?

Maybe something with machineStatus since machineStatus.HomeScreenAppointmentSubject.OnValueChanged:connect(self.HandleAppointmentChanged, self) appears to monitor HKCU\System\State\Appointments\HomeScreen, Subject value

I have tried machineStatus.RemindersShellActive.OnValueChanged:connect(Handle_Reminder1) and machineStatus.ShellRemindersActive.OnValueChanged:connect(Handle_Reminder1) but they break the widgets.

I cannot seem to find where the functions for MusicHelper and machineStatus get defined to see what parameters I need or if I can tweak them to do what I need.
[Windows Mobile Software Development] Dunc001:
I had no idea if it would work or not, just wondered! Try taking all of the 'self' stuff out - I found that quite often works. So just have:

machineStatus.HomeScreenAppointmentSubject.OnValueChanged:connect(HandleAppointmentChanged)

Obviously you need to name the function HandleAppointmentChanged instead of whateverclass.HandleAppointmentChanged. Again, I take no responsibility if you crash ;)
[Windows Mobile Software Development] RoryB:
Yeah I have been trying a lot of things. The HomeScreenAppointmentSubject only changes when the appointment on the home screen changes and does not indicate a change in the reminders which may be a task instead.
[Windows Mobile Software Development] RoryB:
I have my first public trial for Reminder widget based on poyensa's original Note widget work. Currently it shows the active reminder and if there are more current reminders it states how many more. When you have no reminder and tap the sticky note the settings page opens. If you have reminders it taps the notification bar to open it.

If you have not set the tap point for opening your notification bar and you have a reminder it will first ask you to select that point. This is the same as going into the settings and pressing the "Select Notification Bar Tap Point" button.

I am still looking into how to do something like tap opens the reminder poom dialog or maybe a long press to dismiss or snooze. Also, maybe tap the stickpin to get settings so you can change size of font when there is an active reminder.

Install JMLMenuSense.v1.65.cab (or newer).

It is compatible with poyensa's latest version of Notes too.

I tried to set it up to work on any screen size. Please give me some feedback. Also if you have any guidance I would appreciate it.

--------------------------------------------------------------------------------

You also need MortScript Version 4.3 Beta 15. Install this cab and the copy contents from Programs\Mortscript to windows and run it there to register the program.
[Windows Mobile Software Development] poyensa:
installed fine, but i am getting this error when press 'set notification bar tap ...'

i have HD2 -WM6.5- manila 2.5.2018 - Rom ESN 3.14 adapted
[Windows Mobile Software Development] RoryB:
Probably means I need you to run mortscript.exe located in windows folder to associate .mscr files with mortscript. I will add the registry values for association in my next cab.
[Windows Mobile Software Development] poyensa:
thansk RoryB, but no mortscript.exe in my windows folder, i am going to search and install it ...
[Windows Mobile Software Development] RoryB:
Check my sig. I thought mortscript was built into NRG ROM and CHT.

Version 4.3 Beta 15
[Windows Mobile Software Development] poyensa:
i installed the mortscripts.exe and could do everything in the setting menu (.xmu) but when try the test appointment it comes the same error just in the moment when the alarm start.
[Windows Mobile Software Development] RoryB:
I do not speak Spanish, but I think it is an error about certificates. Did you run Mortscript and is it in windows folder? If not copy it to windows and run it there.
[Windows Mobile Software Development] ai6908:
If mortscript is installed by cab found in morts website, it does not install it in windows folder. It does looks like it is not finding the file to run...
[Windows Mobile Software Development] poyensa:
that was ai6, thanks a lot! mrtscript was in program folder instead of windows. Just copied to windows and works fine. Thanks RoryB it looks great, I am going to look deeper now in the script but can confirm now its working in my device :)
[Windows Mobile Software Development] RoryB:
Great to hear. I thought CHT had MortScript in it. I will update post to include Mortscript.
[Windows Mobile Software Development] ai6908:
Nope CHT does not. Most of ROMs here usually has mortscript these days, including nrgz....;)
[Windows Mobile Software Development] RoryB:
Here is a revised cab that does not require JMLMenuSense. It is not as pretty, but it works. It is based on [MortScript] iniEditor by Michoob. You still need MortScript. See quoted post for main idea of looks.
[Windows Mobile Software Development] RoryB:
Finally figured out how to get long press pop up menu to work for me. Here is a cab using that to have two setting choices. One for the notification bar tap point and the other for the settings, which are font size and color.

Here is the code that is a complete change from poyensa's I started with:

--Behaviour when click on widget:
CHTWReminder1Class.ConnectPressHandlers = function(self)
self.hitArea.onPress:connect(self.OnTimePressed, self)
self.hitArea.onRelease:connect(self.OnTimeReleased, self)
self.hitArea.onReleaseOutside:connect(self.OnTimeReleasedOutside, self)
end

CHTWReminder1Class.DisconnectPressHandlers = function(self)
self.hitArea.onPress:disconnect(self.OnTimePressed, self)
self.hitArea.onRelease:disconnect(self.OnTimeReleased, self)
self.hitArea.onReleaseOutside:disconnect(self.OnTimeReleasedOutside, self)
end

CHTWReminder1Class.OnTimePressed = function(self, object, complete)
self.hitFeedback:Press()
self.Reminder1LongPress = false
if self.Reminder1PressTimer then
self.Reminder1PressTimer:Stop()
self.Reminder1PressTimer = nil
end
self.Reminder1PressTimer = timer(0.4)
self.Reminder1PressTimer:Stop()
self.tapStartX = Mouse.x

self.Reminder1PressTimer.OnElapsed:connect(function(self)
if self.Reminder1PressTimer then
self.Reminder1PressTimer:Stop()
self.Reminder1PressTimer = nil
end
self.Reminder1LongPress = true
self.hitFeedback:Release()

if math.abs(Mouse.x - self.tapStartX) > WidgetPages.swipeTolerance - 1 then
return
end

PopUpMenuControl.listCollection:Reset()
PopUpMenuControl.listCollection:AddItem(PopUpMenuControl:GetItem("Settings"))
PopUpMenuControl.listCollection:AddItem(PopUpMenuControl:GetItem("Tap Point"))
PopUpMenuControl:SetVisibleItemCount(2)
PopUpMenuControl:ShowMenu("center", nil, function()
end)
end, self)
self.Reminder1PressTimer:Start()
end

CHTWReminder1Class.OnTimeReleased = function(self, object, complete)
self.hitFeedback:Release()
self.Reminder1PressTimer:Stop()
self.Reminder1PressTimer = nil
if not self.Reminder1LongPress then
x = MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPT") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "APPTALLDAY") + MusicHelper_GetRegDWORDValue(0, "System\\State\\Reminder\\Count", "TASK") + 1
if x ~= 1 then
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1_Tap.mscr")
end
else
self.Reminder1LongPress = false
end
end

CHTWReminder1Class.OnTimeReleasedOutside = function(self)
self.hitFeedback:Release()
self.Reminder1PressTimer:Stop()
self.Reminder1PressTimer = nil
self.Reminder1LongPress = false
end

PopUpMenuControl:AddSimpleItem("Settings", "Change Settings", function()
PopUpMenuControl:HideMenu()
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1_Setting.mscr")
end)

PopUpMenuControl:AddSimpleItem("Tap Point", "Set Tap Point", function()
PopUpMenuControl:HideMenu()
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\Reminder1_TapSetting.mscr")
end)
[Windows Mobile Software Development] poyensa:
Thats very good contribution indeed RoryB, thanks a lot. I have linked to first page post#5. We have been looking how to add the longpress for opening the setting menu but could not make it working yet. Hopefully we will get it with your example! Also we are trying to find how to add gestures, swipe down-up, left-right to the opening of new panels in simclock and new widgets we have in mind.

There is another way to open menu by adding new options in the pup-up menu when longpress a widget being in edit mode, suggested by co0kie:

Unfortunately co0kie is not around and I still didnt find it. Maybe you can help ...
[Windows Mobile Software Development] meltwater:
Excellent work. Sounds like it is shaping up to to be a neat widget.
[Windows Mobile Software Development] poyensa:
I have some problems when install this last cab Rory_CHTwReminder1 - Long Press.cab

I firstly uninstall previous verssion, in my case was the first version.

Then install this last version and Sense does not crash but does not work correctly, I have two Rory_CHTwReminder1 -old and new even old was correctly uninstalled- displayed in my screen and cannot swipe up & down. I have no access to your kitchen so cannot look inside the widget, but this kind of problems are frequent to me when there is a difference in the installing folder in the cab with the name of the widget in CHTWidgetDev.lua, I think some names are mixed.

Anyway I could activate the longpress and its really amazing! when longpress comes up a new pop-up menu with 2 options, similar when longpress over the widget being edit mode. Thanks again RoryB I would askyou please to share the full kitchen, I want to learn ....
[Windows Mobile Software Development] RoryB:
Thank you. I will really like it when I can get it to open the notification poom dialog window directly.
[Windows Mobile Software Development] MichelDiamond:
Perhaps it kicks in, if Sense is about to change the tab. And so the tab goes after the timeout to somethings else like configuring mode of CHT.

You can check this and look for HKCU/Software/HTC/Manila -> CHTI.ManilaState.HomeTabIsActive

This value must be 1 for HomeTab (not 0 or 2)

Only a vague assumption.

A remark for counts of tasks: I would recommend the internal task list of CHT, because this is triggered by more than the count. The count is sometimes not reliable enough.

(and for reminders: Use also remind-text changes as looking for changes)

If you need something for direct access something in POOM or so - just tell me & Mike - perhaps this can be made in chtstate.

But the code looks very well made - it's really cool, what Mortskript can do meanwhile and you have a very straight way and a great modularity of your functions.

Chapeau!

Micha
[Windows Mobile Software Development] RoryB:
Thank you for assuming I know what I am doing that well. Actually I started out with code that was so bad that all the widgets disappeared from the home screen and only the free links showed. Later I thought I got long press working, but I could not flick to the quick links (the free links would flicker). I could only swipe to other home pages. Now after more than 24 hours of playing with it I believe my code works fine. I have played with it so much that if it were a wound your mother would say "stop playing with it or it will never heal."

I cannot seem to find these in CHT registry values. What I am doing is trying to determine if there is an active alarm event for either tasks, appointments or alldayappointments. Then I am displaying the current alarmed item on the sticky note.

When there are no alarms, "HKCU", "System\State\Shell\Reminders", "Active" does not exist. When there are event alarms "Active" contains a string that is the key_name in "HKCU","System\State\Shell\Reminders\key_name" that I use to get these values.

"HKCU","System\State\Shell\Reminders\key_name", "Time"

"HKCU","System\State\Shell\Reminders\key_name", "Description"

"HKCU","System\State\Shell\Reminders\key_name", "Location"

To get the count of other active alarms I read these values that do not exist if there are no items of that type.

"HKLM", "System\State\Reminder\Count", "APPT"

"HKLM", "System\State\Reminder\Count", "APPTALLDAY"

"HKLM", "System\State\Reminder\Count", "TASK"

A GetValueChangedEvent for the Active value above would allow me to get rid of the timer I currently use to check for active event alarm. Or a CHT status that monitors that key so I can monitor its changedevent.

Also, I still have not figured out how to bring up the dialog box of the alarm, so my work around is to have a mortscript tap the top of the screen to open the notification manager where I can pick the notice about an event. So if any of you know how to bring back the reminder dialog after it is hidden it would help.

So far I have not had luck finding how to do that. I am also seeing if I could create my own dialog, but I have not found the code to tell WM to snooze or dismiss the event.

Some of the MortScript only exists because I cannot extract these values from the registry with the lua code, or at least I have not figured out how to do so. If there is a way to extract test from registry values outside manila I might be able to reduce the dependency on MortScript. I have tried MusicHelper_GetRegStrValue, but that did not seem to work.

Where can I find the code or other information related to things like MusicHelper_GetRegDWORDValue and machineStatus?

Thank you, I know I am just beginning to scratch the surface and I appreciate the compliment and encouragement.
[Windows Mobile Software Development] meltwater:
I've lost count the number of times I've got sense to do weird things, that's the problem with the limited debugging available. Takes a lot of trial and error, great when it works though.

I've just started experimenting with the dialogues in sense, not sure if that would be any use (I've not looked to see if you've been using them or not). I've only just started with it so not sure what you can do with them yet.

If you are not using the manila registry folder (any particular reason why not?), then you are stuck with the music helper, unless you use an external app, but it's probably about the same as using mort-script I expect. It would be helpful if we could create our own dlls, but it's getting the functions to be accessible through sense which is difficult.
[Windows Mobile Software Development] :
Possiblw Widget Idea

Hello,

I am very ignorant when it comes to any lua or xml or development of any kind, but am very willing to try anything. So, I present my widget modification idea. What I would like to do is create a single widget that has the flipclock w/ weather and Rat's forecast widget combined(Like in the Red Box). Also I would like to have the functions like Simclock for user Definable(Choose everything like you can with the CHT Quick Links) Quick Link Panels above the clock. If you choose the 3 numbered areas each Panel Pops up.

First, is all of this possible?

Second, if possible, where would I begin?

Thanks,

David
[Windows Mobile Software Development] poyensa:
to make a widget weather is no so easy task, as you can imagine because there is no many weather widgets around, only genious like rat, co0kie or MoonNah could do it up to now.

SimClock v3 was going to include weather info as you want even more. The works were very advanced, but unfortunately simClock has received some critics from oficial CHTteam members that has absolutely dismotivated to continue working on it and any other CHT project.

I hope we can find again motivation to finish simclock v4, then the kitchen will be public, then you can start from there because its much easier to start from another widget and substitute the clock to flipclock.

The option right now should be to start from rat's weather widget and add the co0kie's standalone flipclock. Download that kitchen, uninstall the weather widget and run it devMode, so you can start with small modifications and see how the changes works.

But i recommend to go for some simplier widget if you are not an expert. Play a bit with CHTnotes or some analog clock, run them in devMode and try some edition. I have an idea of a frame widget that can be easily done from notes widget ....