yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] amirdt:
I am new to C# programming (only did C++ and Java till now), so sorry for my question.

I created a small application using the KListControl with ManilaPanelCheckBoxItem, all is presented fine, but I cant find anyway to catch the user selection event back to my code.

Any help will bee greatly appreciated... :)

The List creation section:

this.kListControl1.BeginUpdate();
this.kListControl1.Clear();
for (int i = 0; i < numStations; i++) {
StationListItem item = new StationListItem();
item.YIndex = i;
this.kListControl1.AddItem(item);
item.Checked = false;
item.MainText = stationArray[i].getCity();
item.SecondaryText = stationArray[i].getName();
item.Image = null;
item.Parent = this.kListControl1;
}
this.kListControl1.EndUpdate();

The code where I try to catch the event, none of the methods is being called when I tap on the list:

public class StationListItem : ManilaPanelCheckBoxItem {

new public void OnMouseDown(int X, int Y, ref bool DoScroll) {
DoScroll = true;
}
new public void OnMouseUp(int X, int Y, bool IsSamePoint) {
ManilaMessageBoxHelper.MessageBoxShow("Clicked!", @"You OnMouseUp me! (" + this.YIndex.ToString() + ")", "OK");
}
new public void OnClick() {
ManilaMessageBoxHelper.MessageBoxShow("Clicked!", @"You OnClick me! (" + this.YIndex.ToString() + ")", "OK");
}
new public void StatusChanged() {
ManilaMessageBoxHelper.MessageBoxShow("status!", @"You StatusChanged me! (" + this.YIndex.ToString() + ")", "OK");
}
}
[Windows Mobile Software Development] t0flus:
Not sure what you want to achieve, but I have implemented the code below to make a click event change the checked state of the checkbox. No matter where you click on the item the checkbox is toggled.....

When inserting items:

item.OnClick += new ManilaPanelCheckBoxItem.OnClickEventHandler(item_OnClick);

And the EventHandler looks like this:

void item_OnClick(object Sender)
{
ManilaPanelCheckBoxItem item = (ManilaPanelCheckBoxItem)Sender;
item.Checked = !item.Checked;
}

Øystein
[Windows Mobile Software Development] amirdt:
Many thanks t0flus, your suggestion resolved my issue... :)
[Windows Mobile Software Development] amirdt:
How to iterate kListControl items

Hello, another noob question

I didn't find a way to iterate over all the items inside kListControl, I tried to enumerate the Controls attribute inside the kListControl, but it seems unused (empty).

Any idea?

Thanks
[Windows Mobile Software Development] t0flus:
Most list controls have an Items property but the Manila listcontrol doesn't. You actually use the [] on the control itself....

for (int i = 0; i < this.kListControl1.Count; i++)
{
ManilaPanelCheckBoxItem item = (ManilaPanelCheckBoxItem)this.kListControl1[i];
}
[Windows Mobile Software Development] amirdt:
Many thanks for your reply!

Another issue, when I delete a ManilaPanelCheckBoxItem in the middle of the kListControl, there is an ugly empty hole left in the middle of the list on the screen.

This is the code I tried (and not working well):

ManilaPanelCheckBoxItem item;
kListControl1.BeginUpdate();
int count = 0;
for(int i = 0; i < kListControl1.Count; i++) {
item = (ManilaPanelCheckBoxItem)kListControl1[i];
if(item.Checked) {
kListControl1.RemoveItem(item);
} else {
// Recreate the indexes
item.YIndex = count++;
}
}
kListControl1.EndUpdate();

The only work-around I found is to delete and recreate the whole list every time.
[Windows Mobile Software Development] AgentBignose:
Can you guess when you will release next version Michy?
[Windows Mobile Software Development] djflocko:
Manila SDK Download

Hi,

I tried to download the SDK via rapidshare but it doesn't work. Is there another download location?
[Windows Mobile Software Development] kewl01:
I'm trying to use the library and i noticed there are many controls for example, ManilaPanelItem, ManilaPanelSeperatorItem, etc but what I can see in my toolbox is only 9 controls. Am i missing something here? Also, what do i do with the OpenNETCF.Drawing.dll file?

I tried to add that to my control and it gave some errors..
[Windows Mobile Software Development] amirdt:
All the ManilaPanelxxxItem are not used as stand alone, they are elements you add in your code to the KListControl.

You can see many examples to that in this thread
[Windows Mobile Software Development] Wareczek:
Is there a way to add scroll bar to KListControl ?
[Windows Mobile Software Development] amirdt:
The whole idea is that it is Finger Friendly control, you scroll it by sliding your hand (or stylus) over it, why would you add a scroll bar?
[Windows Mobile Software Development] Wareczek:
I know and that is ok, but in original Manila we have very thin scroll bar not to scroll with, but to know how long our list is.
[Windows Mobile Software Development] VPAFan:
Show Items in KListControl

@all,

does anybody know how to bring an item of a KListControl into the visible region. By program, not with the finger.

greetz
[Windows Mobile Software Development] amirdt:
Hello,

I fail to get mouse down/up event in the ManilaNewTextBox I can only get key down/press/up events, any ideas how to solve it please?
[Windows Mobile Software Development] amirdt:
ManilaMessageBoxHelper not working on landscape.

ManilaMessageBoxHelper not working on landscape.

whenever the application is changing from portrait to landscape, the message box has a lot of drawing issues, and after opening 4-5 times the dialog, the application crashes.

BTW, the strange behavior can also be seen in Visual Studio emulator (in landscape mode).
[Windows Mobile Software Development] Wareczek:
I have a problem with ManilaNewTextBox. Application have 1 form and 2 user controls. This error is only with ManilaNewTextBox. With ManilaTextBox seams to be ok.

Please check source of bug demo: SmartDeviceProject4.zip

Compile and click: open > back > close. Now after closing aplication we have disposing error:

StackTrace	" at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)\r\n at System.Windows.Forms.Control.Dispose(Boolean disposing)\r\n at System.ComponentModel.Component.Dispose()\r\n at MichyPrima.ManilaDotNetSDK.ManilaNewTextBox.Dispose(Boolean disposing)\r\n at System.ComponentModel.Component.Finalize()\r\n"	string
[Windows Mobile Software Development] michyprima:
I'll have a look ;)
[Windows Mobile Software Development] ecmaba64:
Unfortunately this does not seem to be possible. There is an actual TextBox within the control, but its mouse and key events are not exposed.
[Windows Mobile Software Development] amirdt:
Thanks for the reply :)

Is there anyway to do implement a reaction for long press? (for example for opening a context sensitive menu)
[Windows Mobile Software Development] passt_immer:
Hello,

is there anyone who uses win7 x64 with vs08 pro?

My problem is, I have this ugly SQUARES and not your Manila Styles Elements! Is it a problem with x64-support?

Because, if I connect the HTC HD2 over WinMobile Device Center and the application starts on the smartphone, there are no ugly squares. Is it a problem with the OpenCF...dll? How should I handle the OpenCF...dll? Where do I have to copy it? Want also test your SDK... plz help me
[Windows Mobile Software Development] Wareczek:
Please check this as soon as possible :)
[Windows Mobile Software Development] HD2_Noob:
When we'll have a new Version?^^

It is supposed to paint only on the mobile phone and the emulator, but not in the IDE. So thats not a problem, it is by-design ;)
[Windows Mobile Software Development] kewl01:
Is there a way to edit the ManilaPanelItem so that instead of the picture, its a button or lable/text

So it would be something like this:
[Windows Mobile Software Development] michyprima:
Eheh. Busy life. Today I had an exam. Tomorrow I'll have another exam...

There will be new version when I've time to finish it...Sorry.

(Maybe soon - I hope to have some time on this weekend.)
[Windows Mobile Software Development] HD2_Noob:
Good luck with the next exam(s) ^^

Lets hope all that michy get some time this weekend :-P
[Windows Mobile Software Development] tilleke:
I wish him all the best as well. Buona fortuna!

However, remember, first your studies (which is your future), family and friends. Then you can go ahead with the library! I always put my family in the top of the list! Then I look at other things such as programming.
[Windows Mobile Software Development] kewl01:
how exactly do I do this.. I needed a control to look something like this. The title text will be of a large size font and the Main, secondary text remain as how it is now.

_________________________________________________

------------|

Title Text | Main Text

------------| Secondary Text

__________________________________________________

I was thinking maybe I can edit the manilapanelitem since its the closest to what I need. I just have to replace the image with a title text, and maybe shift the Main and secondary text further to the right.

I opened the manilapanelitem and the only thing i see in the class is

public class ManilaPanelOnOffItem : KListControl.IKListItem, IDisposable
{
public ManilaPanelOnOffItem();

public Rectangle Bounds { get; set; }
public ManilaPanelOnOffItem.Status CurrentStatus { get; set; }
public bool Enabled { get; set; }
public int Height { get; set; }
public Image Image { get; set; }
public string MainText { get; set; }
public KListControl Parent { get; set; }
public string SecondaryText { get; set; }
public Color SeparatorColor { get; set; }
public bool ShowSeparator { get; set; }
public int YIndex { get; set; }

public event ManilaPanelOnOffItem.OnClickEventHandler OnClick;
public event ManilaPanelOnOffItem.StatusChangedEventHandler StatusChanged;

public void Dispose();
protected virtual void Dispose(bool disposing);
public void Notify(ManilaPanelOnOffItem.Status Stat);
public void OnMouseDown(int X, int Y, ref bool DoScroll);
public void OnMouseUp(int X, int Y, bool IsSamePoint);
public void Render(Graphics g, Rectangle bounds, bool param1);
protected void SetStatusCore(ManilaPanelOnOffItem.Status Stat);

public enum Status
{
On = 0,
Off = 1,
TurningOn = 2,
TurningOff = 3,
}

public delegate void OnClickEventHandler(object Sender);

public delegate void StatusChangedEventHandler(ManilaOnOffSwitch.Status Status);
}

Am i looking at the wrong place? Where do i edit or make changes etc
[Windows Mobile Software Development] ebernazz2:
Hi kewl01...

Did you download the sample project and look at the new panel item that Michy demonstrated? That is where you will find most of what you are looking for.

Not sure what level you need here but lets start at a high level.

You create a class object that implements Michy's IKListIem.

Then you use the render subroutine to draw the panelitem.

Then us use your newly created class object in the KListControl.

Eric
[Windows Mobile Software Development] amirdt:
Sorry, double post...
[Windows Mobile Software Development] amirdt:
I got a problem with checking the value of ManilaOnOffSwitch.Status:

Doing:

ManilaOnOffSwitch.Status status;
...
if (status == ManilaPanelOnOffItem.Status.On) ...

results with compilation error (operator == not supported).

doing:

if(status.Equals(ManilaPanelOnOffItem.Status.On))...

is not working either.

The only thing that worked for me was:

if((int)status == (int)(ManilaPanelOnOffItem.Status.On))..

Which is ugly, but working....

Another question, is it possible to change the "Off On" text under the button graphics? (for multilingual support).
[Windows Mobile Software Development] Archer:
This is frustrating the hell out of me. I hate having to ask this, but I'm struggling like mad trying to add these controls into VS2008.

I've done what I've always done when adding 3rd party controls, but I'm not getting anywhere with it. Here's what I've done to try and get it working...

Right click the toolbox and select Add Tab.

Give the new tab a name (Manila SDK v2.1)

Select the tab (just to be sure) and then right-click inside it

Select Choose Items

Select Browse and locate the file ManilaDotNetSDK.dll - click Okay

That has always been all I've ever had to do in order to add controls, and it does it here too, but all the controls are greyed out so I can't use them.

Can someone PLEASE help me get this working?

Edit:

When I did this, I had "Show All" selected in the toolbox. If I untick this then the tab just disappears. It's as if it's not meant for the platform I've selected to develop on (.Net 2.0 on Windows Mobile 6 Pro SDK).

Incidentally, if I try it the other usual way (tools, choose toolbox items, and add the DLL), it adds the controls to the general tab, but they're still greyed out.
[Windows Mobile Software Development] ebernazz2:
I think you answered your own question. This SDK requires 3.5 CF and you are on 2.0.

Eric
[Windows Mobile Software Development] Archer:
Thanks, but I've tried both 2.0 and 3.5 with the same result.
[Windows Mobile Software Development] ebernazz2:
Create a new project and list the selections you make along the way so I can see where it may be going off track. It is normal for them to be grey'd out until you have a project that satisfies its requirements.

Eric
[Windows Mobile Software Development] Archer:
Okay, cheers mate.

I do...

new project and select "smart device" and select ".NET Framework 3.5"

I give it a name and click "OK"

I change the platform to "Windows Mobile 6 Professional SDK"

The framework version already says 3.5, so I leave that as it is.

I click "Device Application" and click "OK"

Okay, I don't know what to say now. It's just worked.

Thanks for the help. Something was obviously wrong earlier that is just right now. I have no idea what that is, but it's working now. I did definitely try both 3.5 and 2.0 earlier, but it just didn't work.

Ah well. Cheers mate :)
[Windows Mobile Software Development] michyprima:
you are using 2 different status enums from 2 different classes. try this way:

ManilaOnOffSwitch.Status status;
...
if (status == [B]ManilaPanelOnOffSwitch.Status.On[/B]) ...
[Windows Mobile Software Development] amirdt:
Opps, I probabaly looked at it for at least 30 minutes, and still missed that... :o

Thanks
[Windows Mobile Software Development] Wareczek:
michyprima is there a chance to see new version in this weekend? or checked my problem?
[Windows Mobile Software Development] Archer:
@michyprima.

First off, very nice work mate. I'm very grateful and very impressed, and I know the people that use my app (coming soon!) will be grateful for your finger friendliness too :)

I just have 1 little foible. (I had a few earlier, but I got my head round the best way to work with the controls and it was fine after that).

The ManilaTrackBar doesn't look quite right. Is there any way I can improve the quality of the ends? They don't look properly rounded, as if they're being cut off before they finish.

See the attachment to see what I mean. Both ends look straight, rather than rounded.

Other than that though, top job, and thanks again :)
[Windows Mobile Software Development] TiTidom:
Raise an event with Sender on StatusChanged : ManilaPanelOnOffItem ?

Hi michyprima :)

First of all, many thank's for this sdk :p:D

A question :

I have a list of on / off switch in a Klistcontroll, and i want to raise an event on StatusChanged (that's ok), but in the method declaration :

void thisitem_StatusChanged2(ManilaOnOffSwitch.Status Status)

there's no sender parameter :(

How can i know which control sent an on/off switch event (like with ManilaPanelCheckBoxItem) ?

Thank's for the response, and hope a new version will be available soon ;-)

@++

TiTidom.
[Windows Mobile Software Development] DarkEN_ANGEL:
How to make trackbar works normally in vertical mode ?
[Windows Mobile Software Development] Wareczek:
ManilaNewTextBox events GotFocus and LostFocus dosn't work :(
[Windows Mobile Software Development] WWebber:
1.) When the "ManilaTextBox" field is empty and you focus it, following error is shown:

"An unhandled exception of type 'System.NullReferenceException' occurred in ManilaDotNetSDK.dll"

2.) The "ManilaNewTextBox" does not support GotFocus/LostFocus to show the keyboard.

Am I doing something wrong? using V2.1.

What are the reasons one should use these text fields at all? What are the advantages?
[Windows Mobile Software Development] spastik:
could you please expose the picturebox control under the ManilaPanelItem ?

I need to be able to handle the event on mouse over/onclick/on mouse down of that image but you only let us access to the .image property.

thanks ! :)
[Windows Mobile Software Development] michyprima:
At the moment you have to create an handler for each item :(

I'll fix it in next ver

I'll fix this too

It is not a picturebox the image is painted to the list directly
[Windows Mobile Software Development] spastik:
Thanks for the quick response .... I thought that it was a little picturebox. In that case could you give me some hint to implement the onmousedown event on all the panelitem ? :)
[Windows Mobile Software Development] TiTidom:
Thank's for the response ;-)

By the way, for your next version :p, in the Custom Messagebox, perhaps it would be better to put your form in "Maximised" mode for this control, because when you use it with a maximized project, the top bar from windows mobile appear ;) and it's not very nice :D

@++

TiTidom.
[Windows Mobile Software Development] alto:
Very nice work!

Is the SDK working only with .Net 3.5? I tried also with .Net 2 but without success.
[Windows Mobile Software Development] DerIng:
Source code?

Thanks for Manila SDK!

What about the source code?

It would also help you to get faster bug fixes and even new features!

Of course it's up to you but you probably know that a

.NET dll together with .NET Reflector is already open source ...

So come on and donate the sources please.

Thanks again - DerIng
[Windows Mobile Software Development] :
The library is based off this library, which is open-source:

http://xdaforums.com/showthread.php?t=333124

3.5 only :)
[Windows Mobile Software Development] wesch00:
This will be a constructive critic on the framework, I hope I won't be misunderstood.

I new with Manila, got my HD2 only last week. But I'm familar with mobile developement. My favorite application was easy to move from QVGA resolution to WVGA of the HD2. But thenafter I saw, that the app was no more usable because of the missing stylus, the controls where to samll a.s.o.

After searching in the net I found that Manila SDK and thougth, fine, that could be a solution, look and feel of Manila on the HD2 have beein quite nice.

Downloaded the SDK and started redesing of the app. Unfortunately allready with the first page I run into problems I will describe here.

In my opinion it makes no sense to have ManilaButton, ManilaCheckBox, ManilaOnOffSwisch and ManilaTextBox classes. They make only sense, if the layout of those controls fit into one screen. If there are more than can fit, there is the need to have them somehow in the KListControl and be able to scroll. So why not have "only" items (except a tabpage) and only using a KListControl for a container. If there are only a few controls KListControl doesn't scroll and the behaviour is the same. I came into that problem, because my app has several textboxes and they dont't fit to one screen in case of Manila look and feel.

Then thought, ok let's try to implement a ManilaPanelTextBoxItem as a good sample to get familar with the SDK. Easy to write an own class. But how to get TextBox funtionalty into that item? On mouse down create a TextBox and on MouseUp delete this. Seemed to be easy and did work at the first glance. But then I added more than one of that item into the KListControl and scrolled down. The TextBox allways appeared at the location where it would be if it hadn't been scrolled. Ok, thought there should be some "offset" available on the KListControl I can subtract from the Bounds which should solve the problem. But there isn't.

So, in the current state the SDK has too less features if it will be used in a more serious Manila like app. I understand, the it takes a lot of time to implement all the requests by someone here, especially for one person. That's why again the offer to share the sources with other guys to extend the SDK more frequently. I will also help. We can make a real nice framework out of it.
[Windows Mobile Software Development] PhilMorris:
Thanks for the SDK.

Anybody can tell me how do I make rounded corners on the up and down side of the list ?

Am I missing sth ?

Thanks anyway...
[Windows Mobile Software Development] Reaper:
Hello,

This is my first time using the manilaSDK, it seems pretty good and looks very nice. I do have a question that is probably very noobish, but I can't figure is out. I am adding ManilaPanelItems to a KListControl in the following way:

ManilaPanelItem thisitem = new ManilaPanelItem();
thisitem.YIndex = i;
thisitem.MainText = "Hallo";
KListControl1.AddItem(thisitem);

Can anyone tell me how I can detect when one of these items is clicked and of course which one was clicked so I can do the appropriate action that will follow?

Many thanks in advance. If you need more info let me know
[Windows Mobile Software Development] wesch00:
If it is enough to have YIndex, then you can do:

ManilaPanelItem thisitem = new ManilaPanelItem();

thisitem.YIndex = i;

KListControl1.AddItem(thisitem);

// setting text property should be done after adding it to the item list, some have had problems doung this before.

thisitem.MainText = "Hallo";

// then

thisitem.Click += ClickEventHandler;

private void ClickEventHandler(object sender, EventArgs e)

{

ManilaPanelItem item = sender as ManilaPanelItem;

if (item.YIndex == yourItem) DoWhatYouWantHere();

}
[Windows Mobile Software Development] Reaper:
aha, thanks very much for the reply! Going to give it a try as soon as I get home. I will post back how it goes.

Thanks again!
[Windows Mobile Software Development] PhilMorris:
I want to make sth like this...

ww.nuc.cz/tasksmanila/Screen07.png

like Tasks Manila.

How do I make the rounded corners at the top ?

How do I make it slide from the bottom to the upper side ?

Please help...

Thanks.-
[Windows Mobile Software Development] amirdt:
From the look of it, this is just a regular menu item
[Windows Mobile Software Development] PhilMorris:
Yes, but when I run my project I dont see rounded corners but angled ones.

I am using VS2008, .NETCF 3.5 and Windows Mobile 6.1

What am I doing wrong ?
[Windows Mobile Software Development] amirdt:
It may be part of WM 6.5x

My phone is WM 6.5x, in all the applications, the menu corners are rounded...
[Windows Mobile Software Development] Wareczek:
This is HTC finger friendly menu style. Default WM menu have blue border and is smaller.
[Windows Mobile Software Development] grandboy3000:
i downloaded this but i cant install the rar file. how do i do it?
[Windows Mobile Software Development] Skadork:
Wow this is awesome! I've been looking for something like this! I was playing around with Resco's sdk, but it is not very good.

Keep up the great work! It has a LOT of potential! I also second open sourcing this and setting up an SVN for it or something.

How easy do you think it would be to adapt your code to make it skinable?
[Windows Mobile Software Development] Reaper:
Hi,

I have another small question. Is there any way to make the list item that is clicked highlight, similiar to the effect a button has when it's clicked?

A good example of what I mean is how the call history list looks like sense.
[Windows Mobile Software Development] Wareczek:
michyprima pleeeease, give us update... actual bugs drive me crazy :(
[Windows Mobile Software Development] michyprima:
Version 3 published...

Finally.
[Windows Mobile Software Development] Wareczek:
Unbelievable :)
[Windows Mobile Software Development] Wareczek:
ManilaMessageBoxHelper is broken in 3.0 :/
[Windows Mobile Software Development] michyprima:
ops, I didn't check all the classes.... lol

I'll look into it...sorry!