yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] ai6908:
That's unfortunate...hope he continues to work on developing his widget.
[Windows Mobile Software Development] RoryB:
Learned some more

I tried adding long press to the old version of Notes1 and learned the popup item name has to be unique. When I had the popup open "Settings" it actually opened my Reminder1 settings. So I named "Settings" to Notes1Settings" and it worked.

I have updated my Reminder1 to have "Reminder1Settings" and "Reminder1TapSettings" as the popup window names to avoid future conflicts. I also have made some tweaks. Like when you first install Reminder1 it will ask you to set the tap point. It will also ask if you delete those registry keys.

I tried longpress just opening up settings, but did not like not having a choice to cancel going in to settings (they just open). Here is the code to see how, but I do not recommend using it.

--Behaviour when click on widget:
CHTWNotes1Class.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

CHTWNotes1Class.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

CHTWNotes1Class.OnTimePressed = function(self)
self.hitFeedback:Press()
Notes1LongPress = false
if Notes1PressTimer then
Notes1PressTimer:Stop()
Notes1PressTimer = nil
end
Notes1PressTimer = timer(0.4)
Notes1PressTimer:Stop()
tapStartX = Mouse.x

Notes1PressTimer.OnElapsed:connect(function(self)
if Notes1PressTimer then
Notes1PressTimer:Stop()
Notes1PressTimer = nil
end
Notes1LongPress = true

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

self.hitFeedback:Release()
RunProgram("\\windows\\CHTWnotes1.xmu")
Notes1PressTimer:Start()
end

CHTWNotes1Class.OnTimeReleased = function(self)
self.hitFeedback:Release()
if Notes1PressTimer then
Notes1PressTimer:Stop()
Notes1PressTimer = nil
end
if not Notes1LongPress then
Shell_NavigateTo("\\windows\\MortScript.exe","\\windows\\CHTWnotes1.mscr")
else
Notes1LongPress = false
end
end

CHTWNotes1Class.OnTimeReleasedOutside = function(self)
self.hitFeedback:Release()
if Notes1PressTimer then
Notes1PressTimer:Stop()
Notes1PressTimer = nil
end
Notes1LongPress = false
end
[Windows Mobile Software Development] poyensa:
Hi RoryB I am trying the longpress but i am getting a error at recompile here:

Notes1PressTimer.OnElapsed:connect(function(self)

I have revised your scripts and they are similar, but for me its saying it needs a ")" somewhere, but adding another ")" after self its not the solution ... can you have a look please?
[Windows Mobile Software Development] RoryB:
I could have sworn I copied and pasted exactly as it is working in my Fuze. This is the function. See the end, self) at the bottom.

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

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

self.hitFeedback:Release()
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)
[Windows Mobile Software Development] donwhann:
me too man, simclocks probably my best widget. cant fault it personally......
[Windows Mobile Software Development] RoryB:
Continued experimentation

I have a new version or Reminder1. Now it is self contained other than needing MortScript. The settings are a choice dialog. As a result I have reduced the number of files in the cab to 7 and no longer need iniEditor.mscr or JMLMenuSense. Nothing against them, I just wanted to see if I could limit the number of required additional program/packages. Since I need MortScript anyway I had gone to ininEditor, but since I change only two values in my settings I decided to create a choice dialog within my scripts.
[Windows Mobile Software Development] RoryB:
I have moved my Reminder widget to its own thread

[CHTwidget]CHTw Reminder
[Windows Mobile Software Development] RoryB:
Appointment and tasks

Has anyone thought about a widget that shows both appointments and tasks in sequence? I think it would be nice to just have a chronological list of upcoming events.

I have been trying to read all the lua code pieces associated with the appointment and task widgets, but I am having trouble wrapping my mind around all of it.

Are there graphics? I could not see them called out.

Would I have to go even further into the parts of CHT?

I was hoping to find an easy way to get the appointment list and task list and sort them by date into one list and then show that list.

I am not sure if there is a way to know to go to calendar or task programs based on clicking an item.

If anyone has started and would like to help me or have me help them please let me know.
[Windows Mobile Software Development] RoryB:
So, it looks like I need the mode9 files for Appointment and Task widgets so I can get my AppTask widget's mode9 file correct.

If I use their images I think I do not need to include them in my kitchen, but I have to get the correct information.

If someone has that information I would appreciate it.

Then I can begin writing AppTask widget based on Appointment widget and see how much of the Appointment widget I can use as is.

After I get AppTask working for just appointments I can start the process of getting tasks added.

This mode9 information seems to be the key to getting started.
[Windows Mobile Software Development] poyensa:
Attaching both mode9 files. The graphics are defined there. Maybe useful to look into 45D3F17C_manila -- Co0kieListControl.lua where is controlled the appointments & task list. Also you can have a look into the files modified by CHTtweaks. I got to define the BG transparency, alignment & font for co0kie appointments modifying 45D3F17C_manila -- Co0kieListControl.lua & 5146EC01_manila -- Co0kieAppointments.lua, maybe can give you come clues
[Windows Mobile Software Development] RoryB:
Thank you Poy!

This helps, maybe tomorrow I will get time to test my first alpha of my version of an appointment widget.
[Windows Mobile Software Development] poyensa:
pleased to help, in case you need and beta-tester just send me a pm ...
[Windows Mobile Software Development] RoryB:
Thanks, will I need to change co0kieListGroup1 and co0kieList_Mask1 to be 3 since Task is 2? Or are there more groups and masks that I need to coordinate with?
[Windows Mobile Software Development] poyensa:
uf that question is out of my knowledge ... but i think you are right about to change co0kieListGroup1 and co0kieList_Mask1 to be 3 since Task is 2. I havent seen other files affected. when I did change the list background it affected to appointments and tasks but nothing else.
[Windows Mobile Software Development] RoryB:
Thanks, I'll play it safe and go with "3" for my AppTask widget.
[Windows Mobile Software Development] RoryB:
Failing

I have tried throughout the day and keep failing.

I have a meeting all day tomorrow and am busy this weekend so I am placing it here in the hopes someone smarter than me can find where I am breaking it.

Right now this is supposed to be the appointment widget with a different name of CHTWAppTask.

If I can get past this I can then start the process of trying to add tasks to the list.

If no one can help that's okay because I will keep at this when I have time again.
[Windows Mobile Software Development] RoryB:
Found one thing I suspect:

self.componentID = 205 of Appointments widget needs a number for AppTask widget, but this in the kitchen means I do not have an ID

if not self.addonWidgetID then
newComponent:SetComponentClipCharacter("CHTWidgetDevSlot")
else
newComponent:SetComponentClipCharacter("CHTWidgetSlot" .. tostring(self.addonWidgetID))
end

How can I get an ID number for AppTask's self.componentID = ??

Without this ID number I do not think sequentialLibGen of Co0kieListControl.lua will work and maybe that is what is breaking things right now.
[Windows Mobile Software Development] poyensa:
I am not sure of that. That part is standard for all widgets. The way a new widget get ID number is from the free registry HKCU\Software\HTC\manila\CHTI.AddonWidgets.SlotXX during in the installation process. Have a look also to rat's weather widget (v1) he did work with libraries ....
[Windows Mobile Software Development] RoryB:
I'll download and read when i get a chance. BTW I only find the text "componentID" mentioned in CHTLuaSource files for Appointments and Tasks in CHT_Widgets.lua and a function in Co0kieListControl.lua.

if self._moveGroup then
sequentialLibGen = SequentialLibraryGeneratorint(self.FakeCollection, self._listview:GetMovie(), "home", self._moveGroup.componentID)
else
sequentialLibGen = SequentialLibraryGeneratorint(self.FakeCollection, self._listview:GetMovie(), self._listview.ComponentLibraryName, self._listview.ComponentLibraryID)
end

Maybe WidgetID and ComponentID are not the same thing.
[Windows Mobile Software Development] RoryB:
Still no luck finding more about ComponentID

Currently editing Co0kieAppointments.lua and converting it to 5146EC01_manila to replace the file in \windows. I have it working and have begun adding variables for tasks. No functions yet, but I am working toward trying to add Tasks to the Appointments widget.

Not sure how much I will be able to do this week, but I will keep trying.
[Windows Mobile Software Development] meltwater:
i just posted this else-where, but this is a good place for you guys to see also, hopefully it is helpful:

Adapted a dialogue from Sense, for android-like TOAST display - pops up with a message and then goes again. This is a huge time saver when trying to debug stuff.

ShowDebugDialog("","Pictures Changed","")

-- TOAST type - Debug display (very useful)
-- In: Title, Message, Timer ON/OFF
ShowDebugDialog = function(l_80_0, l_80_1, l_80_2)
if l_80_0 == "" then
l_80_0 = "Debug"
end
if l_80_1 == "" then
l_80_1 = "Msg Error"
end
if l_80_2 == "" then
l_80_2 = "true"
end
local l_80_3 = URL("Manila://TwitterMsgBox.dialog")
l_80_3.Parameters:AddParameter("NeedTimer", l_80_2) --Dialoge pops up and disapears after short time!
l_80_3.Parameters:AddParameter("Title1", l_80_0)
l_80_3.Parameters:AddParameter("OnlyContent", "true")
l_80_3.Parameters:AddParameter("ContentString", l_80_1)
g_DebugDialogRequest = _application.DialogManager:GetDialog(l_80_3)

g_DebugDialogRequest:Show()
end

Let me know if you have issues with it etc.
[Windows Mobile Software Development] RoryB:
AppTask widget

Well I have been doing my digging.

I think I dove into the deep end of the pool and forgot how to swim.

I have struggled to the side and am catching my breath.

I have determined the big thing I would have to do to be able to have appointments and tasks on one widget is rewrite a data loader in CHT_DataLoaders.luac to gather appointments and task into one array.

My head is hurting from this so I will take a break.

Maybe I'll get brave or foolish and try this again in the future.
[Windows Mobile Software Development] RoryB:
Well, I have determined the data of appointments and tasks have different indexes, so I would have to develop a process to convert task items to the appointment format so appointment widget could read them.

Just letting you know I am still trying once in a while.
[Windows Mobile Software Development] RoryB:
Got a headache again. I cannot seem to get the Task data pulled into the appointment widget. Of course this is after I think I got a routine to convert the task data to index the same as the appointment data.

I have even more respect for the creators based on how one minor change can kill the widgets.
[Windows Mobile Software Development] RoryB:
Have an appointment with tasks widget now.

[Manila] Co0kie's Home Tab v2.0.0 - Basic Function Tweaks

I added pop ups and long press pop ups and now I sometimes get where the long press pop ups close as soon as I release them. So I am not able to select the choices. Can you guys post me examples of any long press pop up code you are using for me to compare against?

----------

I forgot tot mention I am using the same logic that worked in Notes by Poyensa and Reminder widget by me. They worked fine and now they all have problems. I do not see overlap in code values, but I am still checking.
[Windows Mobile Software Development] Dunc001:
Hey Poy, Rat and I discussed this at length at one point trying to figure out how to do it with text using the short day names in the same way as displayed in rats weather widgets which would then obviously use the system language. We got as far as being able to always display the current day first (WEDTHUFRISATSUNMONTUEWED) but didn't find a way to leave the weekdays in the same order (SUNMONTUEWEDTHUFRISAT) and highlight the current one. I spent days looking through the weather scripts trying to figure out where the short day names were created and did find them in one of the translation files (can't remember where) but no matter what I tried I couldn't get my scripts to call the translations from the weather scripts. That was about the last thing I was working on before... (;))

Anyway, your way seems like a good solution to keep it simple.

I seem to remember I had decided that if I couldn't find a way of calling the short day translations I was going to create seven reg keys to hold short day names which the user could input through a JML menu. It would then be a matter of positioning 7 text items in a row correctly (ideally you'd need to use a fixed letter width font so all letters would take up the same space otherwise spacing between each day would not be consistent). Then using the same principle as you're using for switching pngs you would then have a big function to define the font colour/size changes for current day:

If today == Monday then

Montext.Color =

Montext.Size =

Tuetext.Color =

Tuetext.Size =

Wedtext.Color =

Wedtext.Size =

Thutext.Color =

Thutext.Size =

Fritext.Color =

Fritext.Size =

Sattext.Color =

Sattext.Size =

Suntext.Color =

Suntext.Size =

End

If today == Tuesday then...

and so on. As I say, the two things that stopped me going further were getting the short day names in system language from elsewhere in Sense (but JML/reg key option would work instead) and finding a font that the spacing would all be the same on so the spacing between each short day name would stay consistent regardless of what letters the day names consisted of.

Size and colour for current day and other days would be specified by user through JML/Registry as always, and if you could be bothered you could also add in an extra layer below the text for dropshadow which user could switch on/off in JML...
[Windows Mobile Software Development] poyensa:
Thankyou so much Dunc, its a pleasure read your comments!!! I am aware about all the problems to do it with text, that is why I have tried this simple solution with graphics, which is much more skinneable: transparencies, shadows, reliefs, etc. I am thinking now how to do it in other languages than WWE, I got an idea while shaving ...

Ok I am uploading the cab in previous post, I have changed the function if today = "Monday" then .... because it will not work in other languages. the solution I am trying now is

Handle_Poy8weekday = function()

local Poy8File = "\\windows\\".. machineStatus.CurrentTime.Value:GetDateString("dddd") .. ".png"

Poy8today:SetTexture(Poy8File)

end

So the users has just to rename the png files according to the weeknames in his own language. Lets see if it works ....
[Windows Mobile Software Development] RoryB:
As I read Dunc's post I was thinking the same thing. Seven images, one for each day highlighted and a tutorial on how to create the images for your language.

The text way would need seven text values in the mode9 file so you could set the font sizes and colors separately. Of course 6 would be set to the same size and color. You would definitely need a monosize font so you could easily get the spacing for the text insertion points.
[Windows Mobile Software Development] rat_2665:
Greetings to you all. The raw weekday function is in this post. For the next day function I made then a little lua snippet (attached). The numerical value of the actual week day you can get with this function

local locday = machineStatus.CurrentTime.Value.DayOfWeek
WeekDayValue.String = tostring(locday)

With this value it should be possible to determine the sequence of the weekdays and also the highlighting of the actual day.
[Windows Mobile Software Development] stopa46:
on my device

Uploaded with ImageShack.us

Poy as You mentioned " that is why I have tried this simple solution with graphics, which is much more skinneable: transparencies, shadows, reliefs, etc...

" it would be great if we could add new backgrounds and text images in JML menu instead overwriting the files in Windows folder :)
[Windows Mobile Software Development] RoryB:
Some questions

I have three questions hopefully you can answer:

1) With CHT code can I check if a process is running and "kill" it?

2) With CHT code can I delete a file or move it?

3) How can I create a loop that will keep checking for a file to exist and then do something and quit once the file does exist?
[Windows Mobile Software Development] palokm:
I got it right?
[Windows Mobile Software Development] poyensa:
:eek: what you did? it looks like some text (STRing) there instead WED
[Windows Mobile Software Development] palokm:
Wednesday is the Slovak-STREDA-STR
[Windows Mobile Software Development] rat_2665:
I've collected some uses of the MusicHelper function in Sense Lua. I think it is the only way for file handling in Sense. Co0kie used it in CHT too. Maybe it answers partly to your questions 2 and 3.
[Windows Mobile Software Development] poyensa:
ooppss ... sorry for my poor slovak :) so you havent changed the rest of the days ... in fact you can do what you like with the png files :) are you using WWE rom or slovak rom? if so, did you change the wednesday.png to streda.png?
[Windows Mobile Software Development] palokm:
Yes I renamed PNG

and edited by GIMP2 PNG

I use WWE ROM, but the Slovak translation
[Windows Mobile Software Development] poyensa:
Thanks for confirming. I did also in Spanish and worked fine ... hope to see your nice PNGs ....
[Windows Mobile Software Development] palokm:
I would have a minor edits

because I got an English Slovak
[Windows Mobile Software Development] palokm:
I do not know whether to understand

but what you create can also be used differently, but I would adjust it to 512x256

use this as a background for hours every day

I tried it with, but it is bad size 512x128

it works, just wants to adjust
[Windows Mobile Software Development] Dunc001:
Hey Rat, long time my friend - hope you are well :cool: Wasn't that the code snippet you sent me which I could only figure out how to use if the current day was always in position 1 rather than the weekdays staying static and the current day moving (ie for Wednesday it would display WEDTHUFRISATSUNMONTUE and so on). Or did you have an idea for how to then match the current day with a string and then highlight the correct day string according to what 'today' is?
[Windows Mobile Software Development] RoryB:
Thank you I'll look these over
[Windows Mobile Software Development] RoryB:
So to kill a process I could use

And a loop to check for file I could use

Filetimer = timer(0.5)
Filetmer:Stop()
Filetimer.OnElapsed:connect(function()
if MusicHelper_FileExist("\\windows\\StartUP\\file name.lnk") then
MusiceHelper_FileDelete("\\windows\\StartUP\\file name.lnk")
if Filetimer then
Filetimer:Stop()
Filetimer = nil
end
else
Filetimer:Start()
end
end)
[Windows Mobile Software Development] poyensa:
I think i understand now. You are using as background of other widgets. It should be better to use Poy6BG v2 for that. Have a look to my sign.

Poy6BG v2 should accept png backgrounds but has to be some errors, at least its not worki.g well niw ... i will look deeper.
[Windows Mobile Software Development] palokm:
Yes I understand.

Only in this way would be the desktop clock changed automatically at 00:00

Poy6BG v2 ... uses this as a dark background for the widget

......................................................................................

is a big problem converted to 512x256?

I tried to test
[Windows Mobile Software Development] poyensa:
Try CHTwPoy6BG_v3.cab, now able to use any PNG as background, any size.
[Windows Mobile Software Development] palokm:
...............OK.................
[Windows Mobile Software Development] rat_2665:
Yeah I'm well, but a little busy ;). So just an idea:

1. Create a sequence with the next day function (yes, it was the code snippet I sent you). First day is the actual day, f. e. WEDTHUFRISATSUNMONTUE.

2. Determine the numerical value x for the actual week day (here 3).

3. Change all positions x (here three) steps to the right. Of course for the last x positions greater 7 you have to start at the beginning. So you get for all x a static sequence like SUNMONTUEWEDTHUFRISAT.

4. Now highlight the x+1 Position. That's the actual day.
[Windows Mobile Software Development] RoryB:
Help please

This does not work for me. I never get the registry change even though the file is deleted earlier.

Filetimer = timer(0.5)
Filetmer:Stop()
Filetimer.OnElapsed:connect(function()
if MusicHelper_FileExists("\\windows\\StartUp\\Voice Command.lnk") then
Filetimer:Start()
else
_application.Store:SetIntValue(Lifetime_Permanent, "CHT.VoiceCommand.Active", 0)
if Filetimer then
Filetimer:Stop()
Filetimer = nil
end
end
[Windows Mobile Software Development] RoryB:
Figured it out from lockscreen lua. You need a timer that can be stopped if you do not have a need for it. So the "if not VoiceCmdCheckCount" does that. Then later in your code you start it again with the timer start command and setting "VoiceCmdCheckCount = 0"

--## handler to check for \windows\startup\voice command.lnk
VoiceCmdCheck = function()
if not VoiceCmdCheckCount or VoiceCmdCheckCount > 60 then
VoiceCmdCheckCount = nil -- set counter to be "off"
VoiceCmdTimer:Stop() --stop after initializing or after 60 seconds
else
VoiceCmdCheckCount = VoiceCmdCheckCount + 1
if VoiceCmdStart == 1 then --starting voice command
if MusicHelper_FileExists("\\windows\\startup\\voice command.lnk") then --if \windows\startup\voice command.lnk exists
_application.Store:SetIntValue(Lifetime_Permanent, "CHT.VoiceCommand.Active", 1)
VoiceCmdCheckCount = nil -- set counter to be "off"
end
elseif VoiceCmdStart == 0 then -- stopping voice command
if not MusicHelper_FileExists("\\windows\\startup\\voice command.lnk") then --if \windows\startup\voice command.lnk is gone
_application.Store:SetIntValue(Lifetime_Permanent, "CHT.VoiceCommand.Active", 0)
VoiceCmdCheckCount = nil -- set counter to be "off"
end
end
end
end

--## timer to check for \windows\startup\voice command.lnk
VoiceCmdTimer = timer(1) -- one second
VoiceCmdTimer:Stop()
VoiceCmdTimer.OnElapsed:connect(VoiceCmdCheck)

-- In each part for start or stop voice command need

-- stop
VoiceCmdStart = 0
VoiceCmdCheckCount = 0 -- set counter to be "on"
VoiceCmdTimer:Start()

-- start
VoiceCmdStart = 1
VoiceCmdCheckCount = 0 -- set counter to be "on"
VoiceCmdTimer:Start()

Now to see if I can figure out if MusicHelper has a process exists check
[Windows Mobile Software Development] RoryB:
MusicHelper_ProcExists("VoiceCmd.exe") and MusicHelper_ProcessExists("VoiceCmd.exe") do not work. The thing that is happening is the file deletes before the process ends so I would prefer to wait to toggle the switch image until after the process actually has been killed.

Even better than killing VoiceCmd.exe would be a command line switch to stop it, but I have not found any switches other than -min for starting it without it announcing itself.