Related
This was from the windows mobile team blog. More to follow but wanted to post it for those who don't read that.
Original link: http://blogs.msdn.com/windowsmobile/archive/2008/06/03/customizing-the-sliding-panel-homescreen.aspx
Customizing the Sliding Panel Homescreen
from Windows Mobile Team Blog by Jorge Peraza
Hi, my name is Jorge Peraza; I am a Developer on the Windows Mobile team that was responsible for the new “Sliding Panel” home screen in Windows Mobile 6.1.
When we were working on the visual style and functionality of the home screen we tried to make something that looked both professional and appealing while still showcasing all the information the user is going to need to know what’s important and requires attention. While I think the default design looks really cool, we added some customization features to enable users to make it their own.
Customizing the layout
The home screen layout can be modified using the same home.xml file from previous versions of WM, the schema of the file was extended to allow the customization of many of its elements, this includes the art assets that are used for most of the plug-ins.
When you open the SlidingPanel.home.xml file (inside \ApplicationData\Home) you will find the plug-in element that corresponds to the sliding panel home screen (its CLSID is {E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}). All the child elements inside it are designed to tweak and customize the way the home screen will look.
The top level element is the plugins tag, this has one attribute called “Order” and it’s used to list the plug-ins that will be shown and the order they are going to be laid out on the screen.
The built in plug-in names are:
1)CClock – The big clock
2)CAppointments - The calendar plugin
3)CHome – The notifications plugin
4)CMyPhotos – The photos plugin
5)CMessage – The message center (this is off by default on all sliding panel built in layouts.
6)CMusic – The music plugin
7)Settings – The settings plug-in
8)Custom Plugin – Users can specify custom plug-ins with static content that can be displayed on the home screen.
For example, the XML snippet bellow moves the photos plug-in to the first position and enables the message center (which is turned off by default on both "Sliding Panel" and "Sliding Panel Media")
<plugin clsid="{E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}" name="Bronze" height="266">
<Plugins Order="CMyPhotos;CClock;CMessage" />
</plugin>
There are many other ways of customizing the home screen using the plug-in settings like overriding the default images or even adding your own custom plug-ins that display static content, I'll post and updated entry latter on on how to do this in detail but for now, you can use the provided home.xml files to start experimenting with this.
The notifications plug-in and message center
In the sliding panel home screen, the notifications plug-in by default serves as a dual-purpose notifications/gateway to all you phone/message accounts where every page represents one account (so, if you have multiple notifications in one category they will be shown as one summary page).
There is however an alternative behavior where individual notifications are added as independent pages (Similar to what the T-Mobile shadow home screen does) and the plug-in only shows accounts that have new notifications in them. One cool feature of this alternate behavior is that each individual notification can be dismissed without having to leave the home screen.
You can enable this alternative behavior by setting the following registry key to a value other than 2 (The actual value indicates how many pages of each notification type will be added to the home screen before collapsing them into a summary page. We have tested 2 and 5 but feel free to experiment with other values)
[HKLM\Software\Microsoft\Chome\Chome]
PageCollapseThreshold: DWORD
Note that this prevents you from being able to access the email/phone account data if there are no notifications for it. If you still want to be able to do that you can always re-enable the message center as described in the previous section as a separate plug-in.
There is one more behavioral change you can make that allows you to “dock” the condensed view of the first plug-in to the top of the screen when it is not active, we added this for people like me that want to have the clock always visible. To enable just set the following registry key to “1”
[HKLM\Software\Microsoft\Chome]
DockOperatorBar: DWORD
Advanced layout modification
There are even more advanced things you can do to further tweak the look of the home screen but it is unsupported by Microsoft at this moment so you’ll have to experiment on your own J (Hint, look at the following files \windows\CHome_240x320.cpr and \windows\CHome_320x240.cpr).
----------------------------------------------------------------------------------------------------
Thanks to djNutz for posting this information & OrganicM for his efforts.
I wanted to create a post with info about what the different keys do in the CHome section of the registry. So, I'll start with a brand new one, that I bet nobody knows about....
[HKLM\Software\Microsoft\Chome\Chome]
PageCollapseThreshold: 2 or 5 (DWORD Value)
This will collapse your Notifications panel to only show active notifications. You can enable this alternative behavior by setting the following registry key to a value other than 2 (The actual value indicates how many pages of each notification type will be added to the home screen before collapsing them into a summary page. 2 and 5 were tested and work pretty well.
More to come of course....
should this change be made to the security section too, or does that matter? actually, do changes to the security section ever matter, cause they seem to apply even when you only edit the software section.
p.s.
i'm pretty sure people are gonna ask, so maybe i'll save some trouble instead of looking like an ass by answering preemptively. This DWORD value must be created with your registry editor, it's not already there, at least on ricky v24.
2 = default or normal (i assume cause it looks the same as before) and 5 = condensed.
But for the rest of us who don't have the time to be on every WM blog and forum at once here's my favorite:
To “dock” the condensed view of the first plug-in to the top of the screen when it is not active, set the following registry key to “1”
[HKLM\Software\Microsoft\Chome]
DockOperatorBar: DWORD
This is so you can have the clock always visible, no matter which panel you're on. You could also set it so that CHome Weather's compact view is always on top. Whatever plugin is first on the list.
More info from MS coming down the pipe:
We can get the day of the week on the clock plugin at the top of CHome by doing this:
Replace this portion...
<!-- Date --> <Text ID="Date" Left="180" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Left" Trimming="EllipsisCharacter"></Text>
With this!
<!-- Date -->
<Text ID="Date" Left="180" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Left" Trimming="EllipsisCharacter"></Text>
<Text ID="Day of Week" Left="65" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Right" Trimming="EllipsisCharacter"></Text>
I will incorporate this in Chome Weather fore sure!
Here you go, the first is my Home
2nd is Scroll Down once
3rd is Scroll Down twice
4th is Scroll Down Thrice
heh
Edit: Tried Month in cpr, no luck.
will keep trying
I'm glad people are finally getting this information out. It makes customization that much easier. I'm adding the tips to the wiki as well, as they come out.
How to Reload the Homescreen
I have two questions:
1. After editing my CHome cpr file, how do I reload the homescreen without having to reboot the device?
2. How can I show any text on the clock panel? Regular text is defined by Text ID = "xxxxx", where xxxxx is something like Time, Network Name, etc. However, suppose I want to have the text "Knowledge Rules", how do I set it up in XML?
I have very little programming and Excalibur experience. So, I apologize if these questions are too naive or have been answered before.
Thanks a lot in advance.
you can use this if you dont use OrganicM Chome Weather
I don't think Microsoft has put out much documentation on the sliding panels plugin yet. Most of the CHome configurations use
Code:
TextID="text 1"
as the delimiter for static text. But that's not to say that the clock plugin will recognize that as a valid section. Could work. Could make your phone useless.
beartard said:
I don't think Microsoft has put out much documentation on the sliding panels plugin yet. Most of the CHome configurations use
Code:
TextID="text 1"
as the delimiter for static text. But that's not to say that the clock plugin will recognize that as a valid section. Could work. Could make your phone useless.
Click to expand...
Click to collapse
I do not understand. How do I make the phone know that:
text 1 = Knowledge Rules?
Typical syntax seems to be Text ID = "xxxx", where xxxx is a variable name, which is recognized by the device. If Text 1 is a valid variable for the device, how do I assign it a value? Am I rambling here?
No, you're not rambling. As far as the information coming from Microsoft and disseminated here on this site goes, it's a best guess right now.
someone at msdn blog asked the same question.
Someone at msdn blog asked the same question. Let's wait to see if we get an answer from there...
From http://blogs.msdn.com/windowsmobile...ustomizing-the-sliding-panel-homescreen.aspx:
"Jorgeba, thanks for taking the time to educate your user. I have some questions.
How do you change the text in the condense clock? The .cpr file has Text ID="Text 1". How is "Text 1" define? I would love to add the date to the condense layout.
The ActionURL and Softkey2 URL in the Appointments plug-in always open calendar in the today view. Is there a way to make one of the button opens calendar in the month view? Setting the default view for calendar does not help."
Easy as pie......
If you know what you are doing.
If you have any xml experience,then you'll know how to adjust x and y values to position things in different places. Yes, you can do that. Just change x=whatever and y=whatever to where you would like them to be. Just know this means that it will start on the left and move x pixels over and y pixels down. If you put in negative values, it will shift them in the opposite direction.
Eg. x=-whatever will move it to the left vs a + value which will move it to the right. Same for y=
Also, you can adjust the valignment and halignment to center, left, or right.
Have fun with these. They apply to everything in your cpr (That's the layout for your homescreen.It's in your \Windows directory on your phone).I mean everything, from where your network displays, right down to your pictures.
That's it. Have fun!
jaymit said:
Hi,
Sorry Im kind of a newbie :s, is it possible to edit home screen panels? I wanted to change the layout and look of the clock plugin.
Thanks!
Click to expand...
Click to collapse
Does anybody know how to change font color for certain panels or certain lines of text in the panel? Is it only possible for the whole homescreen?
As far as I know even as far as old xml coding works, you can only change a font color for a selected word or unselected word. Meaning, if you have the old 6.0 your plugins that are selected could have a different color, but unselected could be another color. This applied to the entire homescreen. I have not seen different colors for different plugins, since each panel style is basically its own plugin (each has its own unique GUID), then I doubt you can change font color for each plugin. You can more than likely only change the active selected panel and inactive panel fonts. I am not sure what their titles are in the cpr, but I know that in the old 6.0, the homecolor was one of the fonts colors and the other was called something else.
Eventhough this is 6.1, it doesn't look like much has changed as far as the fonts color goes. You could, however, always try adding a "fontcolor=" command in the cpr and a hex code and try it, to see if it works.
Hope this helps.
Edit your registry or get CHome Config
Both do the same thing. You want to change the plugin order for CHome. It's located in HKLM\Security\CHome\Default Settings and in HKLM\SOFTWARE\Microsoft\CHome. Edit the order you want your plugins to go. Reboot your phone and the new edits should be reflected in your homescreen layout. If you are having trouble cause this is new. Just search this thread for CHome Configurator. It's stickied at the top of this forum. Download it and it will let you select the order in a much easier way. Make sure you reboot, though, or else your changes won't show. Hope this fixes your problem. Later.
tae-xda said:
How to change the default location for where the CMyPhotos plugin
Click to expand...
Click to collapse
rollingondubs1 said:
I have that already, All my games are under a folder which i cant make it as a action url
Click to expand...
Click to collapse
try this
"ACTIONURL" = "\Windows\Start Menu\Games\xxxxx xxxx.lnk
or this
"ACTIONURL" = "\windows\fexplore.exe; \windows\start menu\games"
Yes you can
One last time, I think I've figured out how to help you.
1. Open Chome Config.
2. Scroll to MyApplication and select it with your center button.
3. Scroll to any page you want to edit. Then scroll down to where it says ActionURL. Press menu.
4. Once in the menu select the "1 Change URL" item.
5. Once you have selected that it will take you to a file explorer. Go to \Windows\Start Menu\Games. This is where your games should be. If not, then wherever you store, your games, navigate yourself to that folder and select the file you want.
I think this should cover it. Hope this solved your problem. HOLLA!!!!
rollingondubs1 said:
I have that already, All my games are under a folder which i cant make it as a action url
Click to expand...
Click to collapse
How to change the location of CMyPhoto to \Storage Card\My Documents\My Picturs
This is a combination of Sid-Shrunk´s IFonz Weather Mortscript and superflysocal´s s2u2 weather Mortscript + modifications made by me to display in IPhonetoday
What it does?
- It displays actual temp + todays forecast in IPhonetoday as an icon
- In Icon click it displays 4 days forecast as icons in IPhonetoday
- It displays todays forecast in the s2u2 slider (Version 1.30 and above) and s2u2 Wallpaper
- It displays tomorrows forecast in s2u2 weather option
- It translates the forecasts (right now only to german feel free to edit and repost)
- It "crops"/changes the forecasts to ~ 14 chars to fit s2u2´s slider and forecast
Install:
- Install Mortscript
- download and extract the zip
- copy s2u2 folder to your Program Files folder (Overwrite files if prompted) [This is optional if you don´t use s2u2 just leave this out and set s2u2forecast=0 in the weather ini]
- copy iPhonetoday folder to your root folder (Overwrite files if prompted, won´t mess with your settings)
- change the settings to your desires in weather.ini in /Iphonetoday/
- start getweather.mscr in /Iphonetoday/weather/ (If you want you can put it into the autostart folder)
For background Development i added the source .psd´s and a script for photoshop for batch processing (In the devtools zip)
Thanks go out to:
- MiToNiOeS for the fantastic IPhonetoday
- A_C for the fantastic S2U2
- Mort for his Mortscript
- superflysocal for his weather wallpaper script which had a big influence on this (Pointing me to mortscript!) and for his wallpapers
- schettj for providing the and base for this script
- Sid-Shrunk who also provided the base for this script
- bluemetalaxe for his Realize weather icons
- someone I can´t remember who proivided the diamond weather png´s (Sorry! Please speak up if you are the one)
- someone I can´t remember for making Refreshtoday.exe (Sorry! Please speak up if you are the one)
Feel free to make Icons and translations for your language and post them here(just look for the translation section in getweather.mscr
Only QVGA for now but also feel free to create Icons backgounds for different resolutions and upload them.
This is the weather.ini
; General settings
;--------------------------------------------
;
location=
;this is your location code(see http://weather.yahoo.com/ on finding your location)
units=c
;this sets the units for temperatures f for farenheit c for celsius
GSMConnection=
;your internetconnection("The Internet","Internet","My ISP"..see settings/connections ...) If you only want to use available connections set GSMConnection=
doe=0
;set this to 1 to Disconnect on exit if Connection was established(doest work on all devices/settings)
bdc=0
;Bypass disabled connection (nodata i.e)
delayHours=1
delayMinutes=0
;how often to try and get the weather
nodata=No Data
;weather text to display when no data availible
dataerror=Data Error
;weather text to display when data corrupted
translate=1
;translate forecasts if set to 1 (note: can also be used to correct forecast to the right legth for the wallpaper theme)
; S2U2 settings
;-------------------------------------------
;
s2u2forecast=1
;set this to 0 to disable the s2u2 forecast completely
s2u2path=\program files\s2u2\
;this sets the path to s2u2
useweatherwallpaper=1
;set this to 0 to disable weather wallpaper
wallpaperfolder=\programme\s2u2\gfx\wallpaper\
;this sets the path to the s2u2 weather wallpapers
wallpapertype=.jpg
;this determines the file type of the wallpapers for s2u2
defwallpaper=def
;this wallpaper is displayed when there is no weather data available (use this without the file extention)
defs2u2text=slide to unlock
;this text is displayed in the slider when there is no weather data available
;
; IPhonetoday settings
;-------------------------------------------
;
iPhonetodayPixPath=\iPhoneToday\icons\weather\
;this sets the path to the weathericons for iPhonetoday
forecastdisplayrow=3
;this sets the row where the 4 day forecast is shown
forecastpageselect=0
;this sets the page where the 4 day forecast is shown
actualdisplayrow=3
;this sets the row in which the actual weather icon is shown
actualcolumn=1
;this sets the column in which the actual weather icon is shown
actualpageselect=0
;this sets the page in which the actual weather icon is shown
iPhonetodayTorF=0
;set this to 0 to display the Temperature values and to 1 to display the forecast text
noweather=0
;Weather Picture if no data available (without file extention)
Preparation
FIRST and MOST IMPORTANT: Back up your phone
1. Download and install iPhoneToday (http://forum.xda-developers.com/showthread.php?t=508429)
1. For my install walkthrough of IphoneToday visit: http://james27007.tripod.com/iPhone-Install.htm
2. Download the weather.zip file from the first post(http://forum.xda-developers.com/showthread.php?t=480686)
3. Unzip the weather.zip file
4. Open the weather.ini file and edit to your settings. Each line is explained in the file. I recommend leaving the settings alone and only changing the location and data connection type.
5. Download and install Mortscript (http://www.sto-helit.de/forum/)
6. Download and install S2U2 (http://s2u2.eqvipage.dk/)
1. Optional Here is the English version http://forum.xda-developers.com/showpost.php?p=4038445&postcount=29
----------------------
Editing the weather.ini file
On the PC Edit the weather.ini file with notepad. There are here is the entire file. Below is the settings I edit/changed :
; General settings
;--------------------------------------------
;
location=
;this is your location code(see http://weather.yahoo.com/ on finding your location)
units=
;this sets the units for temperatures f for farenheit c for celsius
GSMConnection=
;your internetconnection("The Internet","Internet","My ISP"..see settings/connections ...) If you only want to use available connections set GSMConnection=
doe=0
;Disconnect on exit if Connection was established(doest work on all devices/settings)
bdc=0
;Bypass disabled connection (nodata i.e)
delayHours=1
delayMinutes=0
;how often to try and get the weather
nodata=No Data
;weather text to display when no data availible
dataerror=Data Error
;weather text to display when data corrupted
translate=1
;translate forecasts if set to 1 (note: can also be used to correct forecast to the right legth for the wallpaper theme)
; S2U2 settings
;-------------------------------------------
;
s2u2forecast=1
;set this to 0 to disable the s2u2 forecast completely
s2u2path=\program files\s2u2\
;this sets the path to s2u2
useweatherwallpaper=1
;set this to 0 to disable weather wallpaper
wallpaperfolder=\programme\s2u2\gfx\wallpaper\
;this sets the path to the s2u2 weather wallpapers
wallpapertype=.jpg
;this determines the file type of the wallpapers for s2u2
defwallpaper=def
;this wallpaper is displayed when there is no weather data available (use this without the file extention)
defs2u2text=slide to unlock
;this text is displayed in the slider when there is no weather data available
;
; IPhonetoday settings
;-------------------------------------------
;
iPhonetodayPixPath=\iPhoneToday\icons\weather\
;this sets the path to the weathericons for iPhonetoday
forecastdisplayrow=3
;this sets the row where the 4 day forecast is shown
forecastpageselect=0
;this sets the page where the 4 day forecast is shown
actualdisplayrow=3
;this sets the row in which the actual weather icon is shown
actualcolumn = 1
;this sets the column in which the actual weather icon is shown
actualpageselect = 0
;this sets the page in which the actual weather icon is shown
iPhonetodayTorF=0
;set this to 0 to display the Temperature values and to 1 to display the forecast text
noweather=0
;Weather Picture if no data available (without file extention)
----------------------
Most settings have a perfect explanation; here are the ones I edited or changed for English settings
General Settings
1. You need to go to http://weather.yahoo.com/ and look up your location. In the URL you will see after the location a country code. Here are some examples
a. For Sacramento, CA, USA this was the URL:
b. weather.yahoo.com/forecast/USCA0967.html
c. So use USCA0967 as the location
d. For Berman, Germany this was the URL:
e. weather.yahoo.com/forecast/GMXX0014.html
f. So use GMXX0014 as the location
g. For Hong Kong, China this was the URL
h. weather.yahoo.com/forecast/CHXX0170.html
i. So use CHXX0170
2. units=
a. use C for Celsius and F for Fahrenheit
3. GSMConnection=
a. This is how your phone connects to the internet. Leave blank if you want it to use any available connection. Or to set your standard you need to look up your connection:
b. Press Start --> Settings --> Connections --> Connections --> select the Advanced tab --> Select Networks
c. The name in the top drop down box is your connection. I have AT&T so I use Media Net; other possibilities are "The Internet", "Internet", and "My ISP”
4. nodata=No Data
a. This the text that will display when you have no data, I like using “searching”
5. dataerror=Data Error
a. This the text that will display when you have a data error, I leave this alone
S2U2 Settings
6. s2u2forecast=1
a. change to 0 to disable S2U2 completly
7. s2u2path=\program files\s2u2\
a. this sets the path to s2u2 program CHECK LOCATION AND SPELLING!
8. useweatherwallpaper=1
a. set this to 0 to disable weather wallpaper
9. wallpaperfolder=\ program files \s2u2\gfx\wallpaper\
a. this sets the path to s2u2 wallpaper CHECK LOCATION AND SPELLING!
iPhone Today Settings
I left these alone, but the explanations under each line explains it perfectly.
You can Mess with other settings, however I do not recommend it unless you really know what you are doing
----------------------
How to install:
1. On your PC, open “My Computer”, then open your device. You can also use Active Sync, but this is a lot easier. Once you open your device you will be looking at the phone’s root directory; you will navigate from here to copy the files over.
2. On your PC, open the weather folder, open the S2U2 folder, then open the gfx folder. Copy the contests of the gfx folder to your phone under your phone’s \program files\S2U2\gfx folder
3. On your PC, open the weather folder and open the iPhoneToday folder. Copy the Weather folder in there, the weather.ini and Refresh Today.exe files to your phone’s iPhoneToday folder in the root directory, not the one in program files!
4. On your PC, open the weather folder, open the iPhoneToday folder then open the icons folder and copy the weather folder in there to your phone’s iPhoneToday\icons folder.
Here is what the folder tree looks like after you have copied the filter to you phone
5. On your phone, create an icon and point it to the getweather.mscr in your \iPhoneToday\Weather folder. This will start the program.
6. For an auto start option, copy the getweather.mscr to your \windows\startup folder. That way it will run every time you start your phone.
----------------------
S2U2 Settings
When enabled the S2U2 will display tomorrow’s forecast
The only thing you need to do is go into S2U2 settings and set the "Today's Weather Forecast from" to "UserWeather"
If your background is not showing, verify what location it is looking in for the background; there may be a typo in the weather.ini file
----------------------
How it works
When you run getweather.mscr, your phone will connect to the internet and a new icon will appear on your 1st page of iPhoneToday. Note it may overwrite some of the icons. To avoid this place only 4 icons on the top row, that way the icons will be placed under that.
The new icon will be the actual weather for your area. When you press that icon it will be replaced with the forecast for the next 4 days.
To return back to the current weather, press any of the 4 forecast icons, this will remove them and restore the original current weather icon.
Wonderfull !!!!!!!!!
I wonder where can I get the same taskbar.
I would love to have the same as you (battery signalstrength ect.)
Eric
Ok, I copied the files and then ran the getweather.mscr, and the iPhonetodayWeather.mscr, Icons popped up, but I don't think my data connection is working. In setings --> Connections --> Connections It says i connect through "MEdia Net" YEA at&t. Is that what I use in the weather.ini file?
Also what exactly does the mscr files do? And can I move the weather icons to another page on iPhone today?
j101399j said:
Also what exactly does the mscr files do? And can I move the weather icons to another page on iPhone today?
Click to expand...
Click to collapse
Well the mscr files parse the icons.xml seperate it into pages and icons (only in code not in the xml itself) than it replaces the icons you specified in the weather.ini and writes it into the icons.xml. Then it refreshes using refreshtoday.exe. When you click on the icons again it copies a backup of the old icons.xml over the new icons.xml and refreshes again and voila you have the old icons back.
You can move the Weather-Icon to other pages by the weather ini
Just edit "actualpageselect=" and forecastpageselect=
But on refreshing it will always start on the first page. (No way around for now)
hello!
I would like to use your weather scripts & Co. but all I got is what you can see on my screenshot
If I lock my device with S2U2 I cannot see any difference - and no weather information appears
I'm quit sure to copy and edit everthing to your advice but I perhaps I didn't understand it or I miss to do other stuff before.
Can you please explain once more every single step to get a similar result to yours? If something would look ugly (because I use vga diamond) I will change it later on, first I want to see any result.
What I did:
- installed MortScript
- copied S2U2 gfx files
- copied iPhoneToday files from zip
- edited weather.ini
==> location="GMXX0007" for "Berlin"?
==> GSMConnection="VF DE Web" for my vodafone provider
- edited pathname of S2U2
- edited icon position for weather icon & forcast
I would be very happy for any idea
PS: or should I send pm in german
oops - where is the picture?
moesfeld said:
Well the mscr files parse the icons.xml seperate it into pages and icons (only in code not in the xml itself) than it replaces the icons you specified in the weather.ini and writes it into the icons.xml. Then it refreshes using refreshtoday.exe. When you click on the icons again it copies a backup of the old icons.xml over the new icons.xml and refreshes again and voila you have the old icons back.
You can move the Weather-Icon to other pages by the weather ini
Just edit "actualpageselect=" and forecastpageselect=
But on refreshing it will always start on the first page. (No way around for now)
Click to expand...
Click to collapse
Make a lot more sence. Thank you
So I will specify the icons that get changed, a 1st page with one icon. I would like the weather by itself on one page. Still having a hard time setting my location and data connection. When I get that fixed, I'll repost.
By the way, when I use the weather.yahoo.com link and put in my location (well the location where I work) it comes back as Riverside/March AFB Weather is that what I would put for my location? Or put Riverside, CA?MAybe an example of a location. I still get "No Data"; and I left the connection method blank.
j101399j said:
Make a lot more sence. Thank you
So I will specify the icons that get changed, a 1st page with one icon. I would like the weather by itself on one page. Still having a hard time setting my location and data connection. When I get that fixed, I'll repost.
By the way, when I use the weather.yahoo.com link and put in my location (well the location where I work) it comes back as Riverside/March AFB Weather is that what I would put for my location? Or put Riverside, CA?MAybe an example of a location. I still get "No Data"; and I left the connection method blank.
Click to expand...
Click to collapse
You have to put the city code USCA0949 in your case
stevieray said:
hello!
I would like to use your weather scripts & Co. but all I got is what you can see on my screenshot
If I lock my device with S2U2 I cannot see any difference - and no weather information appears
I'm quit sure to copy and edit everthing to your advice but I perhaps I didn't understand it or I miss to do other stuff before.
Can you please explain once more every single step to get a similar result to yours? If something would look ugly (because I use vga diamond) I will change it later on, first I want to see any result.
What I did:
- installed MortScript
- copied S2U2 gfx files
- copied iPhoneToday files from zip
- edited weather.ini
==> location="GMXX0007" for "Berlin"?
==> GSMConnection="VF DE Web" for my vodafone provider
- edited pathname of S2U2
- edited icon position for weather icon & forcast
I would be very happy for any idea
PS: or should I send pm in german
Click to expand...
Click to collapse
Evereything you described looks right. I´ll post a different getweather.mscr that will show errors later.
I have some questions to pinpoint the error:
- Did you try running getweather.mscr when on wifi connection?
- Does the script connect correctly to the Internet?
- Do you have IPhonetoday installed? (If not I will try to make a standalone version for s2u2)
P.s. I think you forgott the screenshot
moesfeld said:
You have to put the city code USCA0949 in your case
Click to expand...
Click to collapse
Now I see it, when I went to the http://weather.yahoo.com the code is in the URL. For Riverside, CA this was the URL:
...weather.yahoo.com/Riverside-California-United-States/USCA0949/forec...
So the USCA0949 is the location I needed.
Thanks
Changed it and I got the "No Data" message. My connection is MEdia Net; I 1st left the GSMConnection= ,blank and it did not connect. Then I added MEdia Net and it worked both on iPhone today and S2U2.
Thank you
First thank you for your answer!
moesfeld said:
- Did you try running getweather.mscr when on wifi connection?
Click to expand...
Click to collapse
No. And what about the "iPhoneTodayWeather.mscr"?
- Does the script connect correctly to the Internet?
Click to expand...
Click to collapse
how do I know? First I tried while connected via ActiveSync - this wouldn't give access to internet I think. Then tried again standalone.
I tried to insert a "message" command in getweather.mcr to trace the script but I didn't see anything on the screen
- Do you have IPhonetoday installed?
Click to expand...
Click to collapse
yes I have. First v0.9.1 then back to v0.9.1.
P.s. I think you forgott the screenshot
Click to expand...
Click to collapse
oops - you are so right and I am so
PS: one more hint: RefreshToday.mscr doesn't do anything
don't believe it!
I'm so sorry!
Now I at home, I at once added the missing screenshot and then...
I tried again the getweather script.
And what happened?
1st: I got an error: no internet... - because I was connected via ActiveSync. Then took off the cable and tried again.
2nd: I saw my traceback message command
and then - tataaaaaaa!!!
I had all the weather stuff as you gave it to us
Now I have to change the qvga wallpaper to vga (for S2U2)
Thank you anyway!!!
Translation?
Quick question, how do I translate? Is this part of the section in the getweather.mscr?
Code:
#Replace forecasts with language specific (also convert to ~ 14 chars legth [depends on width of the word trial&error])
if (translate = 1)
#Remove prefixes in forcasts
cond[FCCounter] = Replace(cond[FCCounter], "AM ", "")
cond[FCCounter] = Replace(cond[FCCounter], "PM ", "")
cond[FCCounter] = Replace(cond[FCCounter], " Early", "")
cond[FCCounter] = Replace(cond[FCCounter], " Late", "")
cond[FCCounter] = Replace(cond[FCCounter], "Few ", "")
cond[FCCounter] = Replace(cond[FCCounter], "Scattered ", "")
#Replace Partial forecasts (e.g. Light Rain/Fog (First line[the ones ending with /] sould be ~8 chars (including /) Second line [starting with /] sould be ~ 7 chars (including /))
# Partly section(Partial)
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/T.Bewö")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "T.Bewöl/")
# Mostly section(Partial)
cond[FCCounter] = Replace(cond[FCCounter], "/Mostly Sunny", "/M.Sonn")
cond[FCCounter] = Replace(cond[FCCounter], "Mostly Sunny/", "M.Sonn./")
So would I change
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/T.Bewö")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "T.Bewöl/")
with
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/PartCldy")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "PartCldy/")
j101399j said:
Quick question, how do I translate? Is this part of the section in the getweather.mscr?
Code:
#Replace forecasts with language specific (also convert to ~ 14 chars legth [depends on width of the word trial&error])
if (translate = 1)
#Remove prefixes in forcasts
cond[FCCounter] = Replace(cond[FCCounter], "AM ", "")
cond[FCCounter] = Replace(cond[FCCounter], "PM ", "")
cond[FCCounter] = Replace(cond[FCCounter], " Early", "")
cond[FCCounter] = Replace(cond[FCCounter], " Late", "")
cond[FCCounter] = Replace(cond[FCCounter], "Few ", "")
cond[FCCounter] = Replace(cond[FCCounter], "Scattered ", "")
#Replace Partial forecasts (e.g. Light Rain/Fog (First line[the ones ending with /] sould be ~8 chars (including /) Second line [starting with /] sould be ~ 7 chars (including /))
# Partly section(Partial)
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/T.Bewö")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "T.Bewöl/")
# Mostly section(Partial)
cond[FCCounter] = Replace(cond[FCCounter], "/Mostly Sunny", "/M.Sonn")
cond[FCCounter] = Replace(cond[FCCounter], "Mostly Sunny/", "M.Sonn./")
So would I change
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/T.Bewö")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "T.Bewöl/")
with
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/PartCldy")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "PartCldy/")
Click to expand...
Click to collapse
Yes that looks right.
Would you mind sharing your translation when you are done?
moesfeld said:
Yes that looks right.
Would you mind sharing your translation when you are done?
Click to expand...
Click to collapse
YES. I will be happy to this is a really fun program
One thing, I am having a very hard time getting the icons to place and show up. I moved the files to the correct location. Changed the location to the USCA#### for my area; set the GSM to MEdia Net. Pressed the getweather.mscr (I added an icon). After a short while I get 1 icon (active temp) on the 0 page in the 3rd row in the 1st position. The 4 forcast icons never shows up. When I press the active icon or rune iPhoneTodayWeather.mscr the forcast icons show up and the active icons goes away.
So I restarted, presses the getweather.mscr, moved the active icon to the bottom bar, so it showed and the forcast did not cover it. YEA!!! But now it does not update. It has stayed at 82 degrees F all night and so far through today. Is it becasue I used the UI to move the icons?
And if I try to change the positions of the icons in the weather.ini file, they get all messed up.
Also how do I translate S2U2? [edit] Just found that I need to change the icons and pictures in S2U2 to change the Morgen. Also I can't get the weather background to work I'll report when I do.
I am trying to understand as much as possible, that way I can (with your premission) also make a walkthrough for this and add it to the iPhone Today Walkthrough
moesfeld said:
Yes that looks right.
Would you mind sharing your translation when you are done?
Click to expand...
Click to collapse
Forgot to ask on this part:
Code:
cond[FCCounter] = Replace(cond[FCCounter], "/Partly Cloudy", "/PartCldy")
cond[FCCounter] = Replace(cond[FCCounter], "Partly Cloudy/", "PartCldy/")
What does the / in the "/Partly Cloudy", mean? I have noticed some entries have the / before the word, some have it after and some even have a period. Just want to make sure I translate correctly.
j101399j said:
Also how do I translate S2U2? It shows the sun (it is very sunny here right now) and it says "Sunny" on the bottom with the temp in the slider bar (still 82 degrees) Above the sun icon there is a Morgen button looking thing. What is that? and how do I change it? It looks like that is part of the slider graphics in S2U2
Click to expand...
Click to collapse
I will make an english version of the s2u2 backgrounds (Morgen is german for tomorrow).
I made that part look as it is part of the slider bu in fact it is part of the background.
- The slider text and the background image show the forecast for today.
- The icon and the text under the morgen show the forecast for tomorrow.
j101399j said:
So I restarted, presses the getweather.mscr, moved the active icon to the bottom bar, so it showed and the forcast did not cover it. YEA!!! But now it does not update. It has stayed at 82 degrees F all night and so far through today. Is it becasue I used the UI to move the icons?
Click to expand...
Click to collapse
If you moved the current weather icon with the gui it won´t update but the script will replace whatever you set in weather.ini.
Moving it to the bottom bar is not possible for now. (I will try to make an option in the next version.)
I made that icon replacing on purpose that way you only see the forecasts when needed.
So if you press on the actual weather icon it will show the forecast. When you press on one of the forecast icons it will go back to normal.
The getweather.mscr downloads the weather and stores it in the registry then it updates the current weather weather Icon (The current weather icon actually doesn´t show the current condition but the forecast for today. The caption shows the current Temp and the min and max temp for the day in the ()
If you press on the current weather Icon it runs iPhoneTodayWeather.mscr (that displays the 4 day forecast)
If you press one of the forecast icons it runs noweather.mscr (that reverts everything back to normal.
j101399j said:
And if I try to change the positions of the icons in the weather.ini file, they get all messed up.
Click to expand...
Click to collapse
Could you describe a little more detailed how everything gets messed up?
This might be a problem in the script.
Basicly the script needs icons that can be replaced. If there are no icons to replace it will create dummy icons by itself maybe i made a little mistake and it will add to many .
j101399j said:
I am trying to understand as much as possible, that way I can (with your premission) also make a walkthrough for this and add it to the iPhone Today Walkthrough
Click to expand...
Click to collapse
Cool as you can see I´m not the best in describing how to set it up
j101399j said:
What does the / in the "/Partly Cloudy", mean? I have noticed some entries have the / before the word, some have it after and some even have a period. Just want to make sure I translate correctly.
Click to expand...
Click to collapse
This is because when the weather is downloaded it is sometimes like sunny/Partly Cloudy
or Partly Cloudy/Sunny or just Partly Cloudy
So if the forecast is like the first 2 The partly cloudy needs to be shortend but if it is like the last there even needs a space to be added.
On the first lines there are AM and PM and some other prefixes striped away bacause the text would be to long.
moesfeld said:
I will make an english version of the s2u2 backgrounds (Morgen is german for tomorrow).
I made that part look as it is part of the slider bu in fact it is part of the background.
- The slider text and the background image show the forecast for today.
- The icon and the text under the morgen show the forecast for tomorrow.
[/qoute]
I have photoshop, I'll see if I can change that part as well, when I get it done I'll post it
moesfeld said:
I will make an english version of the s2u2
If you moved the current weather icon with the gui it won´t update but the script will replace whatever you set in weather.ini.
Moving it to the bottom bar is not possible for now. (I will try to make an option in the next version.)
I made that icon replacing on purpose that way you only see the forecasts when needed.
So if you press on the actual weather icon it will show the forecast. When you press on one of the forecast icons it will go back to normal.
The getweather.mscr downloads the weather and stores it in the registry then it updates the current weather weather Icon (The current weather icon actually doesn´t show the current condition but the forecast for today. The caption shows the current Temp and the min and max temp for the day in the ()
If you press on the current weather Icon it runs iPhoneTodayWeather.mscr (that displays the 4 day forecast)
If you press one of the forecast icons it runs noweather.mscr (that reverts everything back to normal.
Click to expand...
Click to collapse
That is what get messed up; or what I though was messed up. I though the forcast would be there and the actual temp. I did not know pressing the buttons changed that. I just tried that and it is perfect YEA!!!!!
moesfeld said:
I will make an english version of the s2u2
Could you describe a little more detailed how everything gets messed up?
This might be a problem in the script.
Basicly the script needs icons that can be replaced. If there are no icons to replace it will create dummy icons by itself maybe i made a little mistake and it will add to many .
Click to expand...
Click to collapse
Nope, I think the number of dummy icons are just fine.
moesfeld said:
I will make an english version of the s2u2
This is because when the weather is downloaded it is sometimes like sunny/Partly Cloudy
or Partly Cloudy/Sunny or just Partly Cloudy
So if the forecast is like the first 2 The partly cloudy needs to be shortend but if it is like the last there even needs a space to be added.
On the first lines there are AM and PM and some other prefixes striped away bacause the text would be to long.
Click to expand...
Click to collapse
Cool, I'll make an English version and send it to you, let me know after I'm done editing it.
Still trying to get the S2U2 background to work...
Click to expand...
Click to collapse
I may jus jumped da gun on this one yesterday it only seems to allow me to see the full clock when its in X:XX mode but when XX:XX 12:00pm it goes like this screenshot... anyone know how to fix this ?
You have to go into the CPR file (Read up on it in the tutorial I wrote) And modify the value for the size of Clock Text. What is happening is that the box that it is permitted to be in is too small for the whole text, therefore it creates the "..." to let you know that the text extends beyond the limits of the container.
If you need more specific help, I would need to see the Clock Panel code in the CPR file.
Because the SenseSDK which is available at xda lacks a control for the HTC Slider I tried to create my own.
I finally fixed some bugs and changed a bit of the behavior and here is the first release version of my SenseSlider control.
The 2nd release is ready and stable. See Changelog for further info.
Features:
mimics HTC Slider
fully functional .net Control
does not depend on images for the bar background/slider thumb (drawn at runtime) and therefore allows different color-schemes
events for SelectedIndexChanged, StartedSliding, StoppedSliding, OnSliding (Gives thes index of the hovered icon)
supports vibration (aka haptic feedback)
includes a semi-transparent panel for overlay when sliding
does not depend on other control collections (SenseSDK only used for demo application; can be used with any other collection) (does not apply for new version, uses SmartDeviceFrameWork)
changes in the 2nd release:
uses the IImaging-Implementation of the SmartDevice-Framework and is now stable and more flexible (load the IImages with SDF in any way and add them to the slider)
supports an imagefile as slider thumb (see attached screenshot)
great speed improvement (fixed a bug which slowed drawing down)
made the source code of the demo application a lot more readable and understandable (or at least I hope so )
I uploaded a demo application to show some of the control's features. The source code for the demo is also available.
To use the Slider in your own applications just add the SenseSlider.dll and instantiate LunaticShade.SenseSlider (see the source of the demo application for details). (The new Version needs also the OpenNETCF Assemblies enclosed in the package or an installed version of the SmartDeviceFramework on the target device)
At this time the control cannot be drawn at designtime (due to heavy P/Invokes) but you can set the properties and events with the property editor.
Please report any bugs you may encounter.
If you got questions just ask
looks quite interesting. I will give it a try as soon as I can integrate in my apps (testing makes no sense - I also have HD2 )
keep on developing!
Obelix
Looks cool ! I'll try it as soon as a release is available !
Looks nice, not exactly like Sense (no vibration, no left-right/right-left gesture, if I tap&hold some icon and then swipe to left or right, the slider doesn't follow my finger), but good. Can't wait to be able to use it in my apps
first release,
see first post
That's VERY nice mate. I'm also particularly pleased that you used the Sense SDK interface in your demo, as I was considering using this slider in one of my apps that uses the Sense SDK heavily. I'm not considering it any more though - I'm all over it
I'm not currently at a dev machine and therefore can't really check out the control, so I do have one question that I may be able to answer if I looked in the IDE. Can you stop it changing page by sliding left and right on the page itself? I'd rather people had to use the slider to change page.
But yeah, very nice - thanks a lot!
I'm glad to hear that you like it.
johncmolyneux said:
Can you stop it changing page by sliding left and right on the page itself? I'd rather people had to use the slider to change page.
Click to expand...
Click to collapse
Actually it is the WinMo 6.5 TabControl which exposes this behavior. If you slide over a TabPage it changes the tab respectively, the senseslider then only reflects this action. So this is not the default behavior of the Slider (actually you could just set back the SelectedTab if it was not changed by the SenseSlider).
Ah fair enough. I didn't realise you'd used a tab control, but I guess that makes sense.
Thanks for the reply mate
nice control man.
i got 4-5 times a crash on the program. when i changed the button slider color, and stopped the vibration, then when i moved the slider fast from left to right, etc, an error occured.
overall nice work. i don't know if it is your icons, or the real time drawing, but the icons at the slider have a very bad quality. hope you can make the graphics much more similar to the HTC Slider looks
well done for a 0.1 version.
anyone knows what is wrong with this line?
Dim imageNames = assembly.GetManifestResourceNames().Where(Function(r) r.Contains("_b"))
i can't get the slider to work having a vb code. this slider needs so many things. i guess the reason that my slider is not working right now is because of the above code line, which returns me nothing, even though i have a picture which contains _b in the name
TeDeV said:
anyone knows what is wrong with this line?
Dim imageNames = assembly.GetManifestResourceNames().Where(Function(r) r.Contains("_b"))
i can't get the slider to work having a vb code. this slider needs so many things. i guess the reason that my slider is not working right now is because of the above code line, which returns me nothing, even though i have a picture which contains _b in the name
Click to expand...
Click to collapse
your resources have to be embedded. in the file browser of visual studio open the Resources folder (not the resx file!) select the images and in the property window change Build action to embed in resx.
i tried that, but when i add the image in the resources file, and choose the embed build action, i get errors
DividedByZeroException
stackTrace....
"σε LunaticShade.SenseSlider.Draw(Graphics g, Int32 x, Int32 y) σε LunaticShade.SenseSlider.Draw(Graphics g) σε LunaticShade.SenseSlider.OnPaint(PaintEventArgs e) σε System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam) σε System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) σε Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) σε System.Windows.Forms.Application.Run(Form fm) σε PrimeKeys.Form1.Main() "
i also have a question.
how do you "connect" the senseSlider with the tabControl?
for example.... if i had two tabcontrols, how does the SenseSlider, knows which tabcontrol to bind?
i can't find that code in your sample.
TeDeV said:
i tried that, but when i add the image in the resources file, and choose the embed build action, i get errors
DividedByZeroException
stackTrace....
"σε LunaticShade.SenseSlider.Draw(Graphics g, Int32 x, Int32 y) σε LunaticShade.SenseSlider.Draw(Graphics g) σε LunaticShade.SenseSlider.OnPaint(PaintEventArgs e) σε System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam) σε System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) σε Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) σε System.Windows.Forms.Application.Run(Form fm) σε PrimeKeys.Form1.Main() "
Click to expand...
Click to collapse
hm, that's strange. are you using pngs? did you set the IconSize Property of the senseslider? maybe a call of senseslider.updatevalues() in your constructor helps.
i also have a question.
how do you "connect" the senseSlider with the tabControl?
for example.... if i had two tabcontrols, how does the SenseSlider, knows which tabcontrol to bind?
i can't find that code in your sample.
Click to expand...
Click to collapse
actually the senseslider does not know that it controls a tabcontrol. It raises the event SelectedIndexChanged when the user selects an icon. In this event I activate the corresponding TabPage to be active.
yes but the corresponding tabpage of which tabcontrol?
if i have 2 tabcontrols, with 5-6 tabpages inside each tabcontrol, how does the slider knows, to which tabcontrol to bind? i don't get it.
i am creating the senseSlider dynamically. and this is my code...
senseSlider.Location = New System.Drawing.Point(0, 554) '504
'senseSlider.Dock = DockStyle.Bottom
senseSlider.Size = New System.Drawing.Size(480, 84)
senseSlider.BackColor = System.Drawing.Color.FromArgb(CInt(CByte((239))), CInt(CByte((235))), CInt(CByte((239))))
senseSlider.BorderBaseColor = System.Drawing.Color.FromArgb(CInt(CByte((235))), CInt(CByte((235))), CInt(CByte((235))))
senseSlider.DarkBaseColor = System.Drawing.Color.Silver
senseSlider.DarkSliderColor = System.Drawing.Color.FromArgb(CInt(CByte((35))), CInt(CByte((35))), CInt(CByte((35))))
senseSlider.HapticFeedback = True
senseSlider.IconSize = New System.Drawing.Size(72, 72) '56,56
senseSlider.IconSpacing = 25
senseSlider.LightSliderColor = System.Drawing.Color.Silver
senseSlider.UpdateValues()
'=====================
anything wrong there?
ok i have figured it out. it is the IconSize! if i use other png images with different dimensions than yours, then i get that error, no matter what. i don't get it. what is 56,56? because none of your icons are 56x56
yes but the corresponding tabpage of which tabcontrol?
if i have 2 tabcontrols, with 5-6 tabpages inside each tabcontrol, how does the slider knows, to which tabcontrol to bind? i don't get it.
Click to expand...
Click to collapse
The senseslider does not bind to a TabControl it only informs you that the SelectedIndex was changed. In the event handler for SelectedIndexChanged you decide what to do then. That is which TabControl to refresh. If you do nothing, nothing will happen. (In the sample I subscribed to the SelectedIndexChanged event and change the SelectedIndex of the TabControl to the SelectedIndex of the Slider by code).
ok i have figured it out. it is the IconSize! if i use other png images with different dimensions than yours, then i get that error, no matter what. i don't get it. what is 56,56? because none of your icons are 56x56
Click to expand...
Click to collapse
The IconSize only says how big the Icons are drawn. If they are smaller or bigger they will be stretched. I don't know why this does not work but
i will try to figure this out.
Very nice. I've been wanting to write something similar for an app that I want to write. You've just saved me a boatload of work! Thanx!
One issue that I saw though; when the app starts up, the ons screen keyboard icon is displayed over the slider. Opening and closing the keyboard hides the icon. Is there a way to have the application hide the keyboard icon on startup?
the slider must be able to DOCK = bottom.
if i have an app which rotates, then i can't use the height thing, in order to anchor.
and depending on the pda resolution the height will be different. and you have to consider that people want menu bar at the bottom, and not just the slider. so it is difficult to have this without dock = bottom.
thanks
TeDeV said:
the slider must be able to DOCK = bottom.
if i have an app which rotates, then i can't use the height thing, in order to anchor.
and depending on the pda resolution the height will be different. and you have to consider that people want menu bar at the bottom, and not just the slider. so it is difficult to have this without dock = bottom.
thanks
Click to expand...
Click to collapse
But that's a very simple thing to manually code, so not an issue. It would be good to not have to code it though, so docking would be nice.
Edit:
Actually, forget coding. Just anchor it in a panel that's docked to the bottom of your form.
cool. thx for you job.
Wow
Fantastic work - really looking forward to seeing this develop. It's so frustrating that HTC don't just release this stuff so that the developers here can make the phone shine compared to android and iphone - the standard winmo controls are so 1980s !
Cheers
Ian
Hi there,
I'm a little bit stuck with a page transition.
In my app, I select a name from a listbox which is located in another page (Page 2)
Once the name is selected from the listbox (in page 2) it automatically returns to the calling page.
Problem is that during the transition, in the OnNavigatedTo event of Page 1, it fires a query which takes some time and the transition is freezed during that time.
How can I add a ProgressBar to warn the user?
If possible, I'd like to stay as "official" as possible, so my idea is to use the standard ProgressBar supllied in the RTW.
I tried many searches and found nothing close to a workable sample on this.
Any help is much apprecitated in advance!
GFR_2009 said:
Hi there,
I'm a little bit stuck with a page transition.
In my app, I select a name from a listbox which is located in another page (Page 2)
Once the name is selected from the listbox (in page 2) it automatically returns to the calling page.
Problem is that during the transition, in the OnNavigatedTo event of Page 1, it fires a query which takes some time and the transition is freezed during that time.
How can I add a ProgressBar to warn the user?
If possible, I'd like to stay as "official" as possible, so my idea is to use the standard ProgressBar supllied in the RTW.
I tried many searches and found nothing close to a workable sample on this.
Any help is much apprecitated in advance!
Click to expand...
Click to collapse
If you're not already using the PerformanceProgressBar, you should be.
http://www.jeff.wilcox.name/2010/08/performanceprogressbar/
It's pretty much 'plug&play'.
There are 2 ideas which you could try to fix your problem.
An idea that you could try is using a DispatcherTimer. A timer will allow the function to finish loading, while creating an event which will fire to display the progress bar. When the page has finished loading, (say 1 sec) your timer could tick, and do whatever work you need done. Another solution would be to add a Loaded event on the page. This would allow you to run some code once the page is fully loaded. This is probably the best design. To do that, you'd need some code like this:
Code:
public MainPage()
{
InitializeComponent();
Loaded += new RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ProgressBar pb = new ProgressBar();
pb.Style = PhoneApplicationService.Current.State["PerformanceProgressBar"] as Style;
pb.IsIndeterminate = true;
//add it onto the page, since it wasn't done in XAML.
LayoutRoot.Children.Add(pb);
}
Note that you can still create the ProgressBar in XAML, it was just easier to only show 1 file.
williammel,
Thanks a lot for the answer. Very clear and helpful!
Will try it right now.
Cheers,
Gus