yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] leen15:
This code should work for that example:

string PrimaryText = "elpablo75: io ne voglio 10 di campi :P al massimo ci pianto le patate, di patate non ce n'è mai abbastanza.";

string SecondaryText = "08/07/10, 22.02 + " - " + "JMS";

PrimaryText = "JackSMS-Channel" + ":" +
"\r\n" + PrimaryText;

itmMsg = new SensePanelItemEx("itmMsg", PrimaryText, 0, true, "Helvetica Neue OTS", 9f, FontStyle.Regular, SecondaryText, 0, true, "Helvetica Neue OTS", 7f, FontStyle.Regular, false, true);

itmMsg.ButtonAnimation = false;

itmMsg.Thumbnail = _getBitmapFromResource(this._isVGA() ? "vga_NewSMS" : "qvga_NewSMS");
senseList.AddItem(itmMsg);

string PrimaryText = "easyrap: quoto Paolo: W la patata :D :D :D";

string SecondaryText = "08/07/10, 22.03 + " - " + "JMS";

PrimaryText = "JackSMS-Channel" + ":" +
"\r\n" + PrimaryText;

itmMsg = new SensePanelItemEx("itmMsg", PrimaryText, 0, true, "Helvetica Neue OTS", 9f, FontStyle.Regular, SecondaryText, 0, true, "Helvetica Neue OTS", 7f, FontStyle.Regular, false, true);

itmMsg.ButtonAnimation = false;

itmMsg.Thumbnail = _getBitmapFromResource(this._isVGA() ? "vga_NewSMS" : "qvga_NewSMS");
senseList.AddItem(itmMsg);
[Windows Mobile Software Development] leen15:
Yes but it's not Indispensable.. :D

The autoheight should work however :p
[Windows Mobile Software Development] greenhacks:
Spliting primary text will make the measurestring logic fail.

PrimaryText = "JackSMS-Channel" + ":" + "\r\n" + PrimaryText;

Cant do much here. Just for sample, try not to break like with(\r\n) and see if it still has wrap/height issue.

How about if this control had 3rd line? then it would solve your problem, plus you will also be able to apply fontstyle/color/size to each line you want.
[Windows Mobile Software Development] leen15:
See attach for C# version of SensePanelItemEx v0.4 ;)
[Windows Mobile Software Development] leen15:
Yeah it work if i delete "\r\n" :)

So.. 3rd line could be helpful! :D
[Windows Mobile Software Development] greenhacks:
Thanks, updated in main post.
[Windows Mobile Software Development] greenhacks:
Ok, it was already part of my todolist when i first saw your first posted screenshot, and figured it out, that something like Footer would be great in the control.

Will take a look how soon i can get the code updated.
[Windows Mobile Software Development] leen15:
Thanks so much! I've a request, but i don't know if you could help me.

I need something like the screenshot. it is possibile to do? :D
[Windows Mobile Software Development] greenhacks:
Very much possible, but i havent looked in SensePanelBase if i can drop few controls in it. All i think is i need to drop textbox control, so i dont end up creating lot of things for it, rest is easy to draw compared to textbox.

Will try later.
[Windows Mobile Software Development] leen15:
Thanks for your work! :)
[Windows Mobile Software Development] leen15:
One general question..

I've a senseListControl with some CheckBoxItem and a Button to remove the checked items.

How can i loop the item that keep in List after remove for have Primary and Secondary text of each item? :confused:
[Windows Mobile Software Development] greenhacks:
Have you tried senselistctrl.RemoveItem(item_name_here)?
[Windows Mobile Software Development] leen15:
Yeah i Removed the item with that function, but than i cannot recover the remain items..

is not there a function for have the primary and secondary text passing the index or something else so i can while all the elements and have all the primary and secondary text?
[Windows Mobile Software Development] greenhacks:
I think i have not understood your question. Can you give an example or reframe your question?
[Windows Mobile Software Development] leen15:
example:

I've 10 SensePanelCheckBoxItem with various Primary and Secondary text for each item ( The name and the number of the contacts that i send my SMS :P )

Now i can check items that want to delete from the list, so than by pressing a button i call the RemoveItem function for each index that i save on CheckBox_statusChanged.

Now the list contain right contacts for the send, and when i press "Send Button" i need to while all the items for have the name and the number for send the SMS.

So my question is, how can i have Primary and Secondary Text of items that is present in the list? :p

I need something like this:

While (i <= CountContacts)
{
PrimaryText = SenseList.GetPrimaryTextFromIndex( i ); [B]<- I need some function for do this! [/B]
SendSMS(PrimaryText);
i = i + 1;
}
[Windows Mobile Software Development] greenhacks:
You can try to loop in each item in senselist like this.

For Each item As SensePanelCheckboxItem In senselist.Controls

store_in_something_a = item.PrimaryText

store_in_something_b = item.SecondaryText

Next
[Windows Mobile Software Development] greenhacks:
See,

http://xdaforums.com/showpost.php?p=7144986&postcount=64
[Windows Mobile Software Development] leen15:
Thanks a lot! I'll give it a try! ;)
[Windows Mobile Software Development] greenhacks:
Just posted new version: SensePanelItemEx v0.5

Has Footer Property, need to add the same way like Primary/Secondary Text.

If you had to modify the issues related to null in c#, you may have to do that for Footer property also. They are all one below the other.

Let me know if this works.
[Windows Mobile Software Development] leen15:
oook, footer go fine, see my first screenshot.

The problem is if i don't set footer...

See the last 2 item of the second screen, the black panel is a normal SensePanelItem, the red panel is your SensePanelItemEx, with no footer.

The red panel result to have a bigger height of the standard PanelItem.

My Code:

int NullValue = 0;
SensePanelItemEx BoldItem = new SensePanelItemEx("BoldItem", senseItem.PrimaryText, NullValue, true, "Helvetica Neue OTS", 9f, FontStyle.Regular, senseItem.SecondaryText, NullValue, true, "Helvetica Neue OTS", 7f, FontStyle.Regular, null, NullValue, false, null, 0, FontStyle.Regular, false, true);

BoldItem.PrimaryTextForeColor = Color.Red;
BoldItem.SecondaryTextForeColor = Color.Red;
BoldItem.Thumbnail = senseItem.Thumbnail;

senseList.AddItem(BoldItem);
[Windows Mobile Software Development] leen15:
I tried with this in c#, but my problem is that in the same senselist i have first a SenseButtonControl and a SensePanelItem

and when check the senselist.Controls i have a InvalidCastException :(

foreach ( SensePanelCheckboxItem item in senseList.Controls)
{
Messaggio MsgToSend = new Messaggio();
MsgToSend.Number = item.SecondaryText;
Connection.SendMsg(MsgToSend);
}
[Windows Mobile Software Development] leen15:
See attach for C# version of SensePanelItemEx v0.5 :)
[Windows Mobile Software Development] greenhacks:
I am very much aware of it, just dint thought someone would use original panelitem and my panelitemex same time :), i will get it fixed in next release.

But i now hope panel has no issues and work great other than minor height thing.
[Windows Mobile Software Development] greenhacks:
I see, in that case you need to do something like this:

For count As Integer = 0 To senseList.Count - 1

If DirectCast(senseList.Item(count).GetType, System.Type).Name = "SensePanelCheckboxItem" Then

Dim b As String = DirectCast(senseList.Item(count), SensePanelCheckboxItem).PrimaryText

End If

Next
[Windows Mobile Software Development] greenhacks:
Added new control:

SensePanelDiagramHistogram v0.1 (Preview Only - Under Development)

Give feedback with a reason on how you want to use this control as, helps me a lot to develop further, and if i know how it is going to be used, then it will give me motivation too :)
[Windows Mobile Software Development] leen15:
Sorry but there isn't a senseList.Item(count) propriety.. this is my problem.. :confused:
[Windows Mobile Software Development] greenhacks:
Can't be. are you using latest v1.39?

Also i think you must be under sensepanelmoreitem and not under senselistcontrol.

ps:See your pm.
[Windows Mobile Software Development] meltwater:
I'll also need a small logo to add to the about page for when I include your extended controls...no rush though, will be a good while yet anyway!

Excellent work! :D
[Windows Mobile Software Development] greenhacks:
thanks, attached logo, created it quickly :P

though not required, but as you wish.
[Windows Mobile Software Development] LORDShadowMan:
woeeeh! I also could wish something, than i need the sensePanelMoreItem with two clickable parts with two different eventhandlers...

Szenario is: i might habe a list of Objects which i want to select OR change the object. got it? :D
[Windows Mobile Software Development] meltwater:
That would make sense if you had a section which was clearly shown as a graphical handle of some kind. It could be useful to have a separate event for pressing on the graphic (alternatively the eventhandler is passed the location or id of which part has been selected...), would that be enough?

Fingers crossed, next version will be converted to c# as was the last, don't really want to install VB too.
[Windows Mobile Software Development] LORDShadowMan:
Try this:

foreach( Control item in YourListControl.Controls)
{
If (item.GetType().Equals(SensePanelCheckboxItem))
{
String a = ((SensePanelCheckboxItem)item).PrimaryText;
String b = ((SensePanelCheckboxItem)item).SecondaryText;
}

}

It also would be possible to get the Primary and Secondary Text throug the Reflection Class.... but that might be to powerfull for such a task....
[Windows Mobile Software Development] LORDShadowMan:
yep would be enough....

:D
[Windows Mobile Software Development] greenhacks:
Adding eventhandler is most easy part :), should take very less time for me.

Just one question, should primarytext part and secondarytext part and footertext part have a eventhandler?

i will take it as yes for now, and put click eventhandler for all those 3 parts.

I will try not to hold this update and will release in a day or 2.
[Windows Mobile Software Development] greenhacks:
I will try to compile it to DLL, so you can simply add to your project as reference.

That will remove the trouble of vb to c# :).
[Windows Mobile Software Development] LORDShadowMan:
well not necassary but it might be usefull for others... so, why not? THANKS! :D
[Windows Mobile Software Development] greenhacks:
For now i will add 4 Eventhandlers as:

OnClickPrimaryText

OnClickSecondaryText

OnClickFooterText

OnClickThumbnail
[Windows Mobile Software Development] greenhacks:
All this events are coded and tested.

Just fixing 1 minor bug i found while coding those events.
[Windows Mobile Software Development] meltwater:
Yep that would work fine for what I would use it for too!

dll will be fine, can always convert if need to for a specific reason.

Sweet.
[Windows Mobile Software Development] leen15:
if you don't set these events, the panel continous have the default onclick event?

(i don't need separate event :P )
[Windows Mobile Software Development] greenhacks:
Yes, default OnClick still works fine and will fire when clicked anywhere in the control. rest all are region specific.
[Windows Mobile Software Development] leen15:
Thanks.. some news for my textbox with button request? :D
[Windows Mobile Software Development] leen15:
This not help, but in my app after a some up and down at the top and the end of the list of SensePanelItemEx i've this Exception.. :confused:

System.Exception was unhandled

Message="OutOfMemoryException"

StackTrace:

in SensePanelItemEx.OnRender(Graphics g)

in StedySoft.SenseSDK.SenseListControl._renderGraphics()

in StedySoft.SenseSDK.SenseListControl.OnPaint(PaintEventArgs e)

in System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)

in System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

in Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)

in System.Windows.Forms.Form.ShowDialog()

in WinCE.Dialogs.ShowDialog(Form dialog, Control parent)

in JackSMS.FormMessaggi.senseItemContact_OnClick(Object Sender)

in StedySoft.SenseSDK.SensePanelItem._notifyClick()

in StedySoft.SenseSDK.SensePanelItem.OnMouseUp(Int32 x, Int32 y)

in StedySoft.SenseSDK.SenseListControl.OnMouseUp(MouseEventArgs e)

in System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)

in System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

in Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)

in System.Windows.Forms.Form.ShowDialog()

in WinCE.Dialogs.ShowDialog(Form dialog, Control parent)

in JackSMS.FormMain.pictureMessaggi_Click(Object sender, EventArgs e)

in System.Windows.Forms.Control.OnClick(EventArgs e)

in System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)

in System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

in Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)

in System.Windows.Forms.Application.Run(Form fm)

in JackSMS.Program.Main()
[Windows Mobile Software Development] leen15:
a question.. do you have insert a "slide option" in your sensePanelItemEx? if i try to slide my finger from right to left on a SensePanelItemEx it show a blank screen.. how can i disable it?

thanks. ;)

ps: in normal SensePanelItem i dont have this propriety.
[Windows Mobile Software Development] LORDShadowMan:
As i wrote:

#80
[Windows Mobile Software Development] leen15:
i talk about this:

http://xdaforums.com/showpost.php?p=7143871&postcount=56

;)
[Windows Mobile Software Development] LORDShadowMan:
my mistake, sorry :p
[Windows Mobile Software Development] Nightstorm99:
@greenhacks

Hello!

How can you query the mouse position in the Control?

When will the new version of SensePanelItemEx?

Thanks
[Windows Mobile Software Development] greenhacks:
Next version has some major changes in code due to optimization and few features as well. and i may release this weekend.

Can you explain your mouse position question please with what exactly you want to acheive?

If i understand correctly, then you cannot query but what you can do is:

MyBase.ClientRectangle.X and MyBase.ClientRectangle.Y will give you values of mouse click or tap.

Is that what you want?
[Windows Mobile Software Development] Nightstorm99:
Hello!

I want to determine in which image was clicked in my SensePanelImage!?!

For this I need the exact X, Y coordinates. When I query the position with the ClientRectangle Property, I always have the same coordinates.

Thanks
[Windows Mobile Software Development] greenhacks:
I think you need this:

'Hold Mouse click cordinates
Dim mousePoint As System.Drawing.Point = System.Windows.Forms.Control.MousePosition()
Dim pointX As Integer = mousePoint.X - MyBase.ClientRectangle.X
Dim pointY As Integer = mousePoint.Y - MyBase.ClientRectangle.Y

Let me know if that helps.
[Windows Mobile Software Development] Nightstorm99:
Thanks!

This is exactly what I need! :)

Greets
[Windows Mobile Software Development] greenhacks:
Glad it worked :)
[Windows Mobile Software Development] greenhacks:
I commented on this issue in SenseSDK thread:

Read This:

http://xdaforums.com/showpost.php?p=7221280&postcount=985
[Windows Mobile Software Development] meltwater:
Hi,

Just tried the SensePanelItemEx v0.5, works great for the tests I've tried. Unfortunately I'm gonna have to use the source as a base and extend it to meet my needs a little (the source really helps though since I'd struggle/was struggling doing it from scratch). Since my needs are quite specific I don't expect them to be in a generic item, but some parts might be useful. If I do get it working (and I manage to keep it nicely packaged as it is) I'll post it. Need to try out inheriting classes etc, I'm a little rusty on all that.

Need to add a number of extra text items (would it work if setup as a list of text items, so you could define any-number of them, with font, size, location details - same could apply for the graphics too?). Managed to add code to resize the thumbnail image to a set size. Will also want to specify which side to put the thumbnail too.

Hopefully, I can add an action on click will be to insert a number of sub items between the selected and next item in the list. Use in this case is a list of items with facebook status's, including text item showing number of comments, click on the item and it expands to show the comments, click on it again and it hides them again.

Anyway, that's the whole point of giving us the source so we can adapt things. I would have got seriously stuck otherwise.

Also any chance a demo project could be provided? Although for me it would need to be c# for me to use.

Also I would welcome some basic pointers on disposing items etc (do I dispose() each item on exit of the program? or does garbage collection cover this), as I think I'm doing bad things with my memory at the moment.

Thanks for any pointers.

UPDATE:

Look's like I'm getting out of memory exception too (even with/without the thumbnails disabled, get to scroll about 12 items).

Humm real shame because the rest of it is going very nicely!
[Windows Mobile Software Development] leen15:
Hi Dhruwal i've a problem.

I try to import the contact picture in the thumbnail of your SensePanelItemEx, but the image don't adapt to the thumb.

This is my code:

int IndexId = session.Contacts.Items.Find(pdContact, Connection.SenderListMsg[i].Lastsender);
if (IndexId != -1)
{
ItemId id = session.Contacts.Items[IndexId].ItemId;
try
{
Contact c = new Contact(id);
senseItem.Thumbnail = c.Picture;

See my screenshot. ;)

What do i have to add? :p
[Windows Mobile Software Development] greenhacks:
In panel, the thumbnail place is calculated assuming the image provided will be size of 50px. And your contact picture is big in size. thats why it breaks.

In next release i will restrict that and try to resize and fit in that width.
[Windows Mobile Software Development] meltwater:
The code I used in c# is as follows (added fixed property to the control for thumbnail height/width) :

OnRender:
//Draw Thumbnail image

if ((_Thumbnail != null)) {

try {
System.Drawing.Bitmap img_tn = new Bitmap(_Thumbnail);
//g.DrawImage(img_tn, _thumbnailLocationX, ClientRectangle.Top + _thumbnailLocationY);
Rectangle img_rect = new Rectangle(_thumbnailLocationX,ClientRectangle.Top + _thumbnailLocationY,_thumbnailSizeX,_thumbnailSizeY);
ImageAttributes ia = new ImageAttributes();
g.DrawImage(img_tn,img_rect,0, 0, img_tn.Width, img_tn.Height, GraphicsUnit.Pixel, ia);

} catch (Exception ex) {
//Throw exception if any other error caught
throw new Exception(ex.Message);

}

}

Probably not perfect, but enough for my testing...

--------

Has there been any news of/from eboelzner? It would be a shame since the SDK is being used widely on here and has made a huge impact on the visual quality of the apps. Are the extended controls done with his permission (I did notice he put a section for them on his thread so I assume so).

The out of memory thing is just a killer for using the SDK now, otherwise the extended control is fantastic and has allowed me to make huge leaps forward and experiment with GUI design instead of custom control details.

Is there any way to reduce the impact after the exception, can it be catched and clean up before the app is killed, otherwise it kills the app until you softreset?

Also is there any reason why there isn't a default constructor so you can use the default settings and then set the parameters separately? Sorry for all the Qs, just enjoying using it.
[Windows Mobile Software Development] greenhacks:
Has there been any news of/from eboelzner?

No news :(, i can think that he must be busy with some work. But atleast he can leave a small note on his first post informing about his status. I am myself gone crazy with few minor limitations from basepanel which i cant even do anything about it.

Are the extended controls done with his permission

No, but he always mentioned that if we want something than we should extend it, thats why i started redrawing few controls as members wanted more features from controls.

(I did notice he put a section for them on his thread so I assume so)

Where is that? I dint see such thing?

Is there any way to reduce the impact after the exception, can it be catched and clean up before the app is killed, otherwise it kills the app until you softreset?

I found no option :(, also this is kind of issue where it is adviced to close the app i would say, because it has already messed with memory. Still closing app may not free up that memory i believe, and thats the reason phone gets slower and soft reset is all we can do. There may be some way to clean that memory but that will involve something to be written in c++, instead Ed can fix that issue would be more better.

Also is there any reason why there isn't a default constructor so you can use the default settings and then set the parameters separately? Sorry for all the Qs, just enjoying using it.

Is this question related to my control?
[Windows Mobile Software Development] meltwater:
I'm guessing the "Community Contributed SenseList Panel Items" in post#2 was space for this... I hope so, since it is a good way to do things.

I've just noticed his account is still active so hopefully he's just busy for a month or so with other things.

Might try a RAM cleaner and see if that improves it, I've found soft-resetting 20-40 times a day doesn't do your battery much good.

Yep for the SensePanelItemEx, the only way I was able to create it was to use the 3rd constructor (but now I look at it the readme says..."MOST of the property value needs to be passed directly when creating a instance" don't worry about it, you've answered it there (it was the only issue I had taking it out of the box).
[Windows Mobile Software Development] greenhacks:
RAM cleaner is something which you or me can do, but we cant expect all the users who will use the software to do that right, so it is not an option at all possibly.

I was thinking along the line, that this error only comes when we load lots of control. i was thinking to do something like pagination and if there is long list of controls, move them to page 2 or something. that way not all controls gets created. Though it would be too much of work to implement all this. But very little work for Ed to fix it :)

The reason i had to pass all to constructor is only because of auto height feature.

Basepanel fixes it rectangle, and i found no way to resize in the control itself for new height. how ever i did find a workaround which i am trying to implement to control this height issue in a better way.
[Windows Mobile Software Development] meltwater:
Well I'm getting the error for a dozen controls so, but I'll experiment. For now, just trying to reduce the issue so I can develop code, hopefully by the time something is ready to release it'll be resolved. Unfortunately I'm quite new to .net so I tend to code by examples until I've understood it, I don't know much about memory and exceptions.

When you dispose controls, can you dispose items from the sense list after they are added to the list (are they copied into the list or referenced?). If not, when you close and dispose of the controls, do you need to dispose of all the items in the list separately and the list too?

I've spotted a few small overlaps of text on the edges so might need to add a boarder to the resize. But other than that it works beautifully so far.
[Windows Mobile Software Development] greenhacks:
I am not a developer by any chance, but always enjoyed developing since years for fun. And always thought to create some smaller chunks of code and make them as example for new developers. I hope everyone in this world does that for smaller amount of codes so people can always find samples and make somthing better.

If you check the example which Ed provided, he disposes the list control at the end while closing the form. And i beleive when list is getting disposed, all the controls under it also gets disposed (list control must be handling it) so that we dont have to dispose each control manually. Though hope Ed can confirm if this is the case.

Can you take a small screenshot of the area where text overlaps, so i can check with it.