Search Results

Search found 15742 results on 630 pages for 'sent items'.

Page 1/630 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • NCurses, scrolling of multiline items, "current item" pointer and "selected items"

    - by mjf
    I am looking for hints/ideas for the best (most effective) way on how to scroll multi-line items as well as emphasizing of the "current item" and "selected items" such as: 1 FOO ITEM 1 Foo sub-item 2 Foo sub-item 3 Foo sub-item 2 BAR ITEM 1 Bar sub-item 3 BAZ ITEM 1 Baz sub-item 2 Baz sub-item 4 RAB ITEM 5 ZZZ ITEM 1 Zzz sub-item 2 Zzz sub-item 3 Zzz sub-item 4 Zzz sub-item using NCurses (some combination of windows, sub-windows, pads, copywin? Uff! In fact, the lines could exceed the stdscr's width so that possibility to scroll left/right would be also nice - pads?)... The whole items (including the sub-items) are supposed to be emphasized as full-width window/pad areas. The "current item" (including it's set of lines) should be emphasized (i.e. using A_BOLD), selected set of items of choice (including the set of lines for each the selected item) should be emphasized in another way (i.e. using A_REVERSE). What would you choose to cope with it the most effective NCurses way? (The less redrawals/refreshes the better and terminal is supposed to have the ability to change it's size - such as XTerm running under "floating window" management.) Thank you for your ideas (or perhaps some piece of code where something similar is already solved - I was not able to find anything helpful on the Internet. I mean I am not going to copy/paste foreign code but programming NCurses properly is still somehow difficult to me). P.S.: Would you suggest to "smooth-scroll" +1/-1 screen line or rather "jump-scroll" +lines/-lines of the items? (I personally prefer the latter one.) Sincerely, -- mjf

    Read the article

  • Using the Items collection for state management

    - by nikolaosk
    I have explained some of the state mechanisms that we have in our disposal for preserving state in ASP.Net applications in various posts in this blog. You can have a look at this post , this post , this post and this one .My last post was on Application state management and you can read it here . In this post I will show you how to preserve state using the Items collection. Many developers do not know that we have this option as well for state management. With Items state we can pass data between...(read more)

    Read the article

  • Shared email acct - how to move sent mail from all users to shared "sent items"

    - by grojo
    Hi, I've set up a shared email account at Exchange, which several users have access to, as a secondary mailbox (along with their personal mailbox) I would like to know if the following is possible all replies and/or mail created when "in" the shared account, is sent from the shared account all sent mail end up in the sent mail folder of the shared account, not the individual users sent mail folders users can set custom signatures when sending mail from the shared account Is this possible to accomplish with Exchange 2007/Outlook, using server and/or clientside rules? Thanks for your help.

    Read the article

  • Fake sent email appear in my sent items folder

    - by Mike
    I have an email listed as being sent by my outlook account that I did not send. In order to figure out who it was sent to, I forwarded it to the same address (hotmail account) and received a reply that there was no such address. I've tried looking up that address and it does not appear to exist. Can someone fake an email and have it appear in my outlook sent items folder as being sent by me? How can I tell who did this?

    Read the article

  • Mac Mail sent messages not in sent folder

    - by Elizabeth Akers
    Hi. My powerbook G4 has been lobbying for a furlough recently, and its latest prank is to not show sent messages in my sent mailbox. I have always had a copy of every sent message, and now, for some unknown reason, I can only see sent messages from May 7 and earlier. When I did a test, and sent myself an email, it shows up fine in my inbox, but there's nothing in the sent folder. Weird. It also has the little arrow next to messages that I replied to in the inbox. I guess I'm going to have to cc myself on everything until I get this fixed. Also, it's got another new trick, which I'm assuming is unrelated, but I mention it here just in case it is: the battery says it's "good" and has a cycle count of 0, and a full charge capacity of 2139, but for some reason it's all of a sudden not charging when it's plugged in. It works fine when connected to the wall, but there is no battery life at all. Zip. Any thoughts? Is it just time for a new 'book? This one just got back from Apple, having its harddrive replaced for the fourth time (for free, but seriously, this thing is a lemon). Thanks so much, Elizabeth

    Read the article

  • Should my dropdown of recently used items show items I no longer have access to

    - by Dan Hibbert
    We are implementing a client for our document management system. Part of this is the checkin screen where one of the fields a user chooses is the folder where the document should be checked into. In our original system, this was represented with a combobox where a user could hand type a folder path or select a path from a list of 5 folders they'd recently used for checking. It is possible that between the time they used the folder and the time they are doing the new checkin the user will no longer have access to the folder. At present, we still show the folder as an option and then, if the user chooses that folder, display an error message when the user submits the check in. We are thinking of removing these recently used folders the user doesn't have access to (we'll make a check when the form is instantiated) because why show an option if we know it will cause a failure (and another dialog message the user has to OK). However, an opposite opinion is that if we remove those folders, the users will think the system has "forgotten" their recent choices and will lose trust in what they are using. I'd like to get some opinions on the better user experience for this problem.

    Read the article

  • Messages Disappeared from Outlook Sent Folder

    - by Bryan
    Two days ago almost all of the messages in my Microsoft Outlook sent folder disappeared. I say "almost all" because only the messages from the past 2 weeks remain. This led me to believe that they must have been "auto archived," but I can't find an archive file that contains my messages. I've checked the folder where Outlook says it archives messages, but there's not much there. I've changed my settings to prevent Outlook from auto-archiving my messages in the future, but still need the ones that have disappeared. Can anybody help me find my missing messages?

    Read the article

  • Getting a sent MailMessage into the "Sent Folder"

    - by Robert Reid
    I'm sending MailMessages with an SmtpClient (being delivered successfully) using an Exchange Server but would like my sent emails to go to the Sent Folder of the email address I'm sending them from (not happening). using (var mailMessage = new MailMessage("[email protected]", "[email protected]", "subject", "body")) { var smtpClient = new SmtpClient("SmtpHost") { EnableSsl = false, DeliveryMethod = SmtpDeliveryMethod.Network }; // Apply credentials smtpClient.Credentials = new NetworkCredential("smtpUsername", "smtpPassword"); // Send smtpClient.Send(mailMessage); } Is there a configuration I'm missing that will ensure all of my sent emails from "[email protected]" arrive in their Sent Folder?

    Read the article

  • Prepending items in serialscroll

    - by Zack
    Hi, I am using serialscroll plugin for jquery by Ariel Flesler. I am trying to make the vertical scroller to have continues loop without reverting back to first item (which is default functionality). To have continues loop of items i tried to append the items which is working fine and able to achieve when i click on "NEXT". However problem seems to be with "Previous" link where i am trying to prepend the items at the top, it is pending the items however changing the visible items. I understand that prepending the items is causing the index of items to change which is normal. So what i am looking for it to keep showing the visible items even when prepending. Please see this URL where i have put the problem i am facing : http://www.resourceskit.com/test/ Please suggest. Thanks

    Read the article

  • How to remove all ListBox items?

    - by Nano HE
    Hi, I created two RadioButton (Weight and Height). I will do switch between the two categories. But the they share the same ListBox Controllers (listBox1 and listBox2). Is there any good method to clear all the ListBox items simpler? I didn't find the removeAll() for ListBox. I don't like my complex multi-lines style which I posted here. private void Weight_Click(object sender, RoutedEventArgs e) { // switch between the radioButton "Weith" and "Height" // Clear all the items first listBox1.Items.Remove("foot"); listBox1.Items.Remove("inch"); listBox1.Items.Remove("meter"); listBox2.Items.Remove("foot"); listBox2.Items.Remove("inch"); listBox2.Items.Remove("meter"); // Add source units items for listBox1 listBox1.Items.Add("kilogram"); listBox1.Items.Add("pound"); // Add target units items for listBox2 listBox2.Items.Add("kilogram"); listBox2.Items.Add("pound"); } private void Height_Click(object sender, RoutedEventArgs e) { // switch between the radioButton "Weith" and "Height" // Clear all the items first listBox1.Items.Remove("kilogram"); listBox1.Items.Remove("pound"); listBox2.Items.Remove("kilogram"); listBox2.Items.Remove("pound"); // Add source units items for listBox1 listBox1.Items.Add("foot"); listBox1.Items.Add("inch"); listBox1.Items.Add("meter"); // Add target units items for listBox2 listBox2.Items.Add("foot"); listBox2.Items.Add("inch"); listBox2.Items.Add("meter"); }

    Read the article

  • Randomly placing items script not working - sometimes items spawn in walls, sometimes items spawn in weird locations

    - by Timothy Williams
    I'm trying to figure out a way to randomly spawn items throughout my level, however I need to make sure they won't spawn inside another object (walls, etc.) Here's the code I'm currently using, it's based on the Physics.CheckSphere(); function. This runs OnLevelWasLoaded(); It spawns the items perfectly fine, but sometimes items spawn partway in walls. And sometimes items will spawn outside of the SpawnBox range (no clue why it does that.) //This is what randomly generates all the items. void SpawnItems () { if (Application.loadedLevelName == "Menu" || Application.loadedLevelName == "End Demo") return; //The bottom corner of the box we want to spawn items in. Vector3 spawnBoxBot = Vector3.zero; //Top corner. Vector3 spawnBoxTop = Vector3.zero; //If we're in the dungeon, set the box to the dungeon box and tell the items we want to spawn. if (Application.loadedLevelName == "dungeonScene") { spawnBoxBot = new Vector3 (8.857f, 0, 9.06f); spawnBoxTop = new Vector3 (-27.98f, 2.4f, -15); itemSpawn = dungeonSpawn; } //Spawn all the items. for (i = 0; i != itemSpawn.Length; i ++) { spawnedItem = null; //Zeroes out our random location Vector3 randomLocation = Vector3.zero; //Gets the meshfilter of the item we'll be spawning MeshFilter mf = itemSpawn[i].GetComponent<MeshFilter>(); //Gets it's bounds (see how big it is) Bounds bounds = mf.sharedMesh.bounds; //Get it's radius float maxRadius = new Vector3 (bounds.extents.x + 10f, bounds.extents.y + 10f, bounds.extents.z + 10f).magnitude * 5f; //Set which layer is the no walls layer var NoWallsLayer = 1 << LayerMask.NameToLayer("NoWallsLayer"); //Use that layer as your layermask. LayerMask layerMask = ~(1 << NoWallsLayer); //If we're in the dungeon, certain items need to spawn on certain halves. if (Application.loadedLevelName == "dungeonScene") { if (itemSpawn[i].name == "key2" || itemSpawn[i].name == "teddyBearLW" || itemSpawn[i].name == "teddyBearLW_Admiration" || itemSpawn[i].name == "radio") randomLocation = new Vector3(Random.Range(spawnBoxBot.x, -26.96f), Random.Range(spawnBoxBot.y, spawnBoxTop.y), Random.Range(spawnBoxBot.z, -2.141f)); else randomLocation = new Vector3(Random.Range(spawnBoxBot.x, spawnBoxTop.x), Random.Range(spawnBoxBot.y, spawnBoxTop.y), Random.Range(-2.374f, spawnBoxTop.z)); } //Otherwise just spawn them in the box. else randomLocation = new Vector3(Random.Range(spawnBoxBot.x, spawnBoxTop.x), Random.Range(spawnBoxBot.y, spawnBoxTop.y), Random.Range(spawnBoxBot.z, spawnBoxTop.z)); //This is what actually spawns the item. It checks to see if the spot where we want to instantiate it is clear, and if so it instatiates it. Otherwise we have to repeat the whole process again. if (Physics.CheckSphere(randomLocation, maxRadius, layerMask)) spawnedItem = Instantiate(itemSpawn[i], randomLocation, Random.rotation); else i --; //If we spawned something, set it's name to what it's supposed to be. Removes the (clone) addon. if (spawnedItem != null) spawnedItem.name = itemSpawn[i].name; } } What I'm asking for is if you know what's going wrong with this code that it would spawn stuff in walls. Or, if you could provide me with links/code/ideas of a better way to check if an item will spawn in a wall (some other function than Physics.CheckSphere). I've been working on this for a long time, and nothing I try seems to work. Any help is appreciated.

    Read the article

  • HttpContext.Items and Server.Transfer/Execute

    - by Rick Strahl
    A few days ago my buddy Ben Jones pointed out that he ran into a bug in the ScriptContainer control in the West Wind Web and Ajax Toolkit. The problem was basically that when a Server.Transfer call was applied the script container (and also various ClientScriptProxy script embedding routines) would potentially fail to load up the specified scripts. It turns out the problem is due to the fact that the various components in the toolkit use request specific singletons via a Current property. I use a static Current property tied to a Context.Items[] entry to handle this type of operation which looks something like this: /// <summary> /// Current instance of this class which should always be used to /// access this object. There are no public constructors to /// ensure the reference is used as a Singleton to further /// ensure that all scripts are written to the same clientscript /// manager. /// </summary> public static ClientScriptProxy Current { get { if (HttpContext.Current == null) return new ClientScriptProxy(); ClientScriptProxy proxy = null; if (HttpContext.Current.Items.Contains(STR_CONTEXTID)) proxy = HttpContext.Current.Items[STR_CONTEXTID] as ClientScriptProxy; else { proxy = new ClientScriptProxy(); HttpContext.Current.Items[STR_CONTEXTID] = proxy; } return proxy; } } The proxy is attached to a Context.Items[] item which makes the instance Request specific. This works perfectly fine in most situations EXCEPT when you’re dealing with Server.Transfer/Execute requests. Server.Transfer doesn’t cause Context.Items to be cleared so both the current transferred request and the original request’s Context.Items collection apply. For the ClientScriptProxy this causes a problem because script references are tracked on a per request basis in Context.Items to check for script duplication. Once a script is rendered an ID is written into the Context collection and so considered ‘rendered’: // No dupes - ref script include only once if (HttpContext.Current.Items.Contains( STR_SCRIPTITEM_IDENTITIFIER + fileId ) ) return; HttpContext.Current.Items.Add(STR_SCRIPTITEM_IDENTITIFIER + fileId, string.Empty); where the fileId is the script name or unique identifier. The problem is on the Transferred page the item will already exist in Context and so fail to render because it thinks the script has already rendered based on the Context item. Bummer. The workaround for this is simple once you know what’s going on, but in this case it was a bitch to track down because the context items are used in many places throughout this class. The trick is to determine when a request is transferred and then removing the specific keys. The first issue is to determine if a script is in a Trransfer or Execute call: if (HttpContext.Current.CurrentHandler != HttpContext.Current.Handler) Context.Handler is the original handler and CurrentHandler is the actual currently executing handler that is running when a Transfer/Execute is active. You can also use Context.PreviousHandler to get the last handler and chain through the whole list of handlers applied if Transfer calls are nested (dog help us all for the person debugging that). For the ClientScriptProxy the full logic to check for a transfer and remove the code looks like this: /// <summary> /// Clears all the request specific context items which are script references /// and the script placement index. /// </summary> public void ClearContextItemsOnTransfer() { if (HttpContext.Current != null) { // Check for Server.Transfer/Execute calls - we need to clear out Context.Items if (HttpContext.Current.CurrentHandler != HttpContext.Current.Handler) { List<string> Keys = HttpContext.Current.Items.Keys.Cast<string>().Where(s => s.StartsWith(STR_SCRIPTITEM_IDENTITIFIER) || s == STR_ScriptResourceIndex).ToList(); foreach (string key in Keys) { HttpContext.Current.Items.Remove(key); } } } } along with a small update to the Current property getter that sets a global flag to indicate whether the request was transferred: if (!proxy.IsTransferred && HttpContext.Current.Handler != HttpContext.Current.CurrentHandler) { proxy.ClearContextItemsOnTransfer(); proxy.IsTransferred = true; } return proxy; I know this is pretty ugly, but it works and it’s actually minimal fuss without affecting the behavior of the rest of the class. Ben had a different solution that involved explicitly clearing out the Context items and replacing the collection with a manually maintained list of items which also works, but required changes through the code to make this work. In hindsight, it would have been better to use a single object that encapsulates all the ‘persisted’ values and store that object in Context instead of all these individual small morsels. Hindsight is always 20/20 though :-}. If possible use Page.Items ClientScriptProxy is a generic component that can be used from anywhere in ASP.NET, so there are various methods that are not Page specific on this component which is why I used Context.Items, rather than the Page.Items collection.Page.Items would be a better choice since it will sidestep the above Server.Transfer nightmares as the Page is reloaded completely and so any new Page gets a new Items collection. No fuss there. So for the ScriptContainer control, which has to live on the page the behavior is a little different. It is attached to Page.Items (since it’s a control): /// <summary> /// Returns a current instance of this control if an instance /// is already loaded on the page. Otherwise a new instance is /// created, added to the Form and returned. /// /// It's important this function is not called too early in the /// page cycle - it should not be called before Page.OnInit(). /// /// This property is the preferred way to get a reference to a /// ScriptContainer control that is either already on a page /// or needs to be created. Controls in particular should always /// use this property. /// </summary> public static ScriptContainer Current { get { // We need a context for this to work! if (HttpContext.Current == null) return null; Page page = HttpContext.Current.CurrentHandler as Page; if (page == null) throw new InvalidOperationException(Resources.ERROR_ScriptContainer_OnlyWorks_With_PageBasedHandlers); ScriptContainer ctl = null; // Retrieve the current instance ctl = page.Items[STR_CONTEXTID] as ScriptContainer; if (ctl != null) return ctl; ctl = new ScriptContainer(); page.Form.Controls.Add(ctl); return ctl; } } The biggest issue with this approach is that you have to explicitly retrieve the page in the static Current property. Notice again the use of CurrentHandler (rather than Handler which was my original implementation) to ensure you get the latest page including the one that Server.Transfer fired. Server.Transfer and Server.Execute are Evil All that said – this fix is probably for the 2 people who are crazy enough to rely on Server.Transfer/Execute. :-} There are so many weird behavior problems with these commands that I avoid them at all costs. I don’t think I have a single application that uses either of these commands… Related Resources Full source of ClientScriptProxy.cs (repository) Part of the West Wind Web Toolkit Static Singletons for ASP.NET Controls Post © Rick Strahl, West Wind Technologies, 2005-2010Posted in ASP.NET  

    Read the article

  • Deleted items on Deleted Items folder are not shown

    - by Ken
    When I run this cmdlet, I get the following result: [PS] C:\Windows\system32Get-MailboxFolderStatistics user | ft FolderPath, FolderSize -autosize FolderPath FolderSize ---------- ---------- /Top of Information Store 156 B (156 bytes) /Calendar 244.2 KB (250,025 bytes) /Contacts 1.223 MB (1,282,252 bytes) /Contacts/SenderPhotoContacts 30.41 KB (31,139 bytes) /Conversation Action Settings 0 B (0 bytes) /Conversation History 206.2 KB (211,147 bytes) /Deleted Items 1.449 MB (1,519,602 bytes) /Drafts 472 B (472 bytes) /Inbox 618 MB (648,025,798 bytes) /Journal 144 B (144 bytes) /Junk E-Mail 131.9 KB (135,089 bytes) /News Feed 0 B (0 bytes) /Notes 1.847 KB (1,891 bytes) /Outbox 0 B (0 bytes) /Quick Step Settings 0 B (0 bytes) /RSS Feeds 0 B (0 bytes) /Sent Items 6.754 KB (6,916 bytes) /Suggested Contacts 9.316 KB (9,540 bytes) /Sync Issues 0 B (0 bytes) /Sync Issues/Conflicts 0 B (0 bytes) /Sync Issues/Local Failures 0 B (0 bytes) /Sync Issues/Server Failures 0 B (0 bytes) /Tasks 7.994 KB (8,186 bytes) /Recoverable Items 12.16 MB (12,748,519 bytes) /Deletions 0 B (0 bytes) /Purges 0 B (0 bytes) /Versions 0 B (0 bytes) But when I open the mailbox using both Outlook and OWA, the deleted items folder is empty. I'm guessing it's corrupted or something like that. Is it possible to recover it somehow? Thanks.

    Read the article

  • Deleted items on Deleted Items folder are not shown

    - by Ken
    When I run this cmdlet, I get the following result: Get-MailboxFolderStatistics user | ft FolderPath, FolderSize -autosize FolderPath FolderSize ---------- ---------- /Top of Information Store 156 B (156 bytes) /Calendar 244.2 KB (250,025 bytes) /Contacts 1.223 MB (1,282,252 bytes) /Contacts/SenderPhotoContacts 30.41 KB (31,139 bytes) /Conversation Action Settings 0 B (0 bytes) /Conversation History 206.2 KB (211,147 bytes) /Deleted Items 1.449 MB (1,519,602 bytes) /Drafts 472 B (472 bytes) /Inbox 618 MB (648,025,798 bytes) /Journal 144 B (144 bytes) /Junk E-Mail 131.9 KB (135,089 bytes) /News Feed 0 B (0 bytes) /Notes 1.847 KB (1,891 bytes) /Outbox 0 B (0 bytes) /Quick Step Settings 0 B (0 bytes) /RSS Feeds 0 B (0 bytes) /Sent Items 6.754 KB (6,916 bytes) /Suggested Contacts 9.316 KB (9,540 bytes) /Sync Issues 0 B (0 bytes) /Sync Issues/Conflicts 0 B (0 bytes) /Sync Issues/Local Failures 0 B (0 bytes) /Sync Issues/Server Failures 0 B (0 bytes) /Tasks 7.994 KB (8,186 bytes) /Recoverable Items 12.16 MB (12,748,519 bytes) /Deletions 0 B (0 bytes) /Purges 0 B (0 bytes) /Versions 0 B (0 bytes) But when I open the mailbox using both Outlook and OWA, the deleted items folder is empty. I'm guessing it's corrupted or something like that. Is it possible to recover it somehow? Thanks.

    Read the article

  • Get ListView Visible items

    - by Vincent Piel
    I have a ListView which might contains a lot of items, so it is virtualized and recycling items. It does not use sort. I need to refresh some value display, but when there are too many items, it is too slow to update everything, so I would like to refresh only the visible items. How could I get a list of all currently displayed items ? I tried to look into the ListView or in the ScrollViewer, but I still have no idea how to achieve this. The solution must NOT go through all items to test if they can be seen, because this would be too slow. I'm not sure code or xaml would be usefull, it is just a Virtualized/Recycling ListView with its ItemSource bound to an Array. Edit Answer : thanks to akjoshi, i found the way : get the ScrollViewer of the ListView (with a FindDescendant method, that you can do yourself with the VisualTreeHelper ). Then use its ScrollViewer.VerticalOffset : it is the number of the first item shown and ScrollViewer.ViewportHeight : it is the count of items shown. Rq : CanContentScroll must be true.

    Read the article

  • All possible combinations of n items selected randomly from a set of x items (algorithm)

    - by SubPortal
    I have a set of x string items e.g("A","B","C","D","E","F") I need to know the formula that calculates how many combinations of n items and what is the algorithm that generates all possible combinations e.g if we need to select 4 items from the list randomly. those 4 items could be: ("A","B","C","D") or ("A","B","C","E") or ("A","B","C","F") or ("A","B","D","E") ...etc I need the formula that calculates how many sets of items will be generated without repetition, that is we consider ("A","B","C","D") as one of the resulted combinations we cannot consider the same items as another resultant combination with replacing the positions of the items in the set like ("A","B","D","C") Also I need the algorithm that generates all possible combinations in any programming language. [C#,VB.NET,Java,C++] Thank you for any help.

    Read the article

  • WPF ContextMenu with bound items: Items.Count == 0 in ContextMenuOpening event

    - by OregonGhost
    I have a ContextMenu with the ItemsSource bound to the selected item of a list view, like this: <ContextMenu ItemsSource="{Binding Path=PlacementTarget.SelectedItem, RelativeSource={RelativeSource Self}, Converter={StaticResource possibleConverter}}"/> The possibleConverter enumerates all possible values for a property of the the selected item, which are shown in the context menu. In the Opened event of the context menu, I select the current value like this: var cm = e.OriginalSource as ContextMenu; if (cm != null) { var lv = cm.PlacementTarget as ListView; var field = lv.SelectedItem as Field; var item = cm.ItemContainerGenerator.ContainerFromItem(cm.Items.OfType<object>().Where(o => o.ToString().Equals(field.StringValue)).FirstOrDefault()) as MenuItem; if (item != null) { item.IsChecked = true; } } Not particularly elegant, but it works. With the debugger I verified that the ContextMenu.Items.Count property has a non-zero value when expected (i.e. cm.Items.Count is non-zero in the if). So far, so good. There are, however, items in the listview where the context menu will have no items. In this case, an empty menu is shown. I tried to suppress this in the ContextMenuOpening event in the list view, like this: var lv = sender as ListView; if (lv != null) { var cm = lv.ContextMenu; if ((cm != null) && (cm.Items.Count > 0)) { // Here we want to check the current item, which is currently done in the Opened event. } else { e.Handled = true; } } Seems like it should work. However, cm.Items.Count is always zero. This is true even if ListView.SelectedItem did not change: For an item with menu entries, the menu is shown correctly after the first click, so the data binding has already happend. It is shown correct the second time as well, but in any case, Items.Count is zero in the ContextMenuOpening event. What am I missing? How can I suppress empty context menus? Why is the count zero in the ContextMenuOpening handler, which is in Windows Forms (ContextMenuStrip.Opening) the canonical point where to do these things? EDIT: Upon further investigating, it turns out that in the ContextMenuOpening handler, any binding to the listview fails, which is why ItemsSource is null. I tried to bind via ElementName, via a FindAncestor relationship, all to no avail. The PlacementTarget is null during that event. An ugly hack worked though: In the ContextMenuOpening event, I assign the list view to the ContextMenu.Tag property, while the ItemsSource binding now binds to Tag.SelectedItem. This updates the binding, so Items.Count is what it should be. It's still strange. How can you do meaningful things in ContextMenuOpening other than replacing the menu or something, if the binding fails because somehow the context menu is out of context during the event? Was it only tested with static pre-defined menu items?

    Read the article

  • Where to implement storable items

    - by James Hay
    I'm creating a multiplayer online trading game. The things that are traded range from raw items to complex products. For example Steel is a raw item. Mechanical Assembly is a more complex item that requires 2x Steel and maybe 1x Rubber. Then Hydraulics is an item that contains 2x Mechanical Assemblies and 1x Electronics (which is another complex item). So and so forth. These items will be created by me, players can't create their own items, so it doesn't need to be able to handle arbitrary layers of complexity for items. If my example isn't clear, think Minecraft. You have wooden planks, which can be made into sticks. From there the sticks - combined with metals - can be made into tools. My game is nothing to do with minecraft or any sandbox building game, but it uses a similar progressive complexity to creating items that I want to have in my game. My question is basically, how do you store something like this assuming that I will want to add more items in the future? Do you store it in a database or in a seperate library that the game uses? EDIT None of the items actually "do" anything, they are simply there to either sell, purchase, or combine with other items to make a more complex item, which can then be sold, purchased or combined... you get the idea. The items themselves would not have any properties, but the instances of the items would. For example an item that one player has would have a certain "quality" and if they were selling it a certain "price". An instance of that same item that a different player had would need to have a different "quality" and "price" if they were selling it. I think the price part will not be required on an individual item because instead I would have a "sale" object which was for a price and contained certain items.

    Read the article

  • wxPython - Save Items in ListCtrl

    - by dpswt
    Hello everyone. My question is if we can save the items on ListCtrl so everytime someone opens the application, the items are there and if the user removes it, it also removes from the configuration. I know that I can use wx.Config and I'm trying to accomplish using that but I don't know how to read it in a way to accomplish what I want. So what I would like to know is a proper way to write/read the wx.Config in a way that everytime someone opens the application, the items from ListCtrl are there. Thanks in advance.

    Read the article

  • Android: how do i custom arrange menu items?

    - by mtmurdock
    I would like to arrange the menu items in my app so that one item appears in its own line, and the other 3 items appear below it. I know that this is possible because i have seen apps do it. I tried writing a menu xml with linear layouts to arrange the items, but this doesnt work. I have also tried putting them in different groups, but I had no luck with that either. I know that this is possible: i have seen it done. Anyone have any ideas?

    Read the article

  • Binding WPF menu items to WPF Tab Control Items collection

    - by William
    I have a WPF Menu and a Tab control. I would like the list of menu items to be generated from the collection of TabItems on my tab control. I am binding my tab control to a collection to generate the TabItems. I have a TabItem style that uses a ContentPresenter to display the TabItem text in a TextBlock. When I bind the tab items to my menu the menu items are blank. I assume the menu items are looking for the Header property of the TabItems which I am not using. Is there a workaround for my scenario? Is it possible to bind to the Header property of the tab item, when I do not know the number of tabs in advance? Below is a copy of my xaml declarations. Tab Control and items: <DataTemplate x:Key="ClosableTabItemTemplate"> <DockPanel HorizontalAlignment="Stretch"> <Button Command="{Binding Path=CloseWorkSpaceCommand}" Content="X" Cursor="Hand" DockPanel.Dock="Right" Focusable="False" FontFamily="Courier" FontSize="9" FontWeight="Bold" Margin="10,1,0,0" Padding="0" VerticalContentAlignment="Bottom" Width="16" Height="16" Background="Red" /> <ContentPresenter HorizontalAlignment="Center" Content="{Binding Path=DisplayName}"> <ContentPresenter.Resources> <Style TargetType="{x:Type TextBlock}"/> </ContentPresenter.Resources> </ContentPresenter> </DockPanel> </DataTemplate> <DataTemplate x:Key="WorkspacesTemplate"> <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" ItemTemplate="{StaticResource ClosableTabItemTemplate}" Margin="10" Background="#4C4C4C"/> </DataTemplate> My Menu <Menu Background="Transparent"> <MenuItem Style="{StaticResource TabMenuButtonStyle}" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabControl}}, Path=Items}" ItemContainerStyle="{StaticResource TabMenuItem}"> </MenuItem> </Menu>

    Read the article

  • Why can't Java servlet sent out an object ?

    - by Frank
    I use the following method to send out an object from a servlet : public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException { String Full_URL=request.getRequestURL().append("?"+request.getQueryString()).toString(); String Contact_Id=request.getParameter("Contact_Id"); String Time_Stamp=Get_Date_Format(6),query="select from "+Contact_Info_Entry.class.getName()+" where Contact_Id == '"+Contact_Id+"' order by Contact_Id desc"; PersistenceManager pm=null; try { pm=PMF.get().getPersistenceManager(); // note that this returns a list, there could be multiple, DataStore does not ensure uniqueness for non-primary key fields List<Contact_Info_Entry> results=(List<Contact_Info_Entry>)pm.newQuery(query).execute(); Write_Serialized_XML(response.getOutputStream(),results.get(0)); } catch (Exception e) { Send_Email(Email_From,Email_To,"Check_License_Servlet Error [ "+Time_Stamp+" ]",new Text(e.toString()+"\n"+Get_Stack_Trace(e)),null); } finally { pm.close(); } } /** Writes the object and CLOSES the stream. Uses the persistance delegate registered in this class. * @param os The stream to write to. * @param o The object to be serialized. */ public static void writeXMLObject(OutputStream os,Object o) { // Classloader reference must be set since netBeans uses another class loader to loead the bean wich will fail in some circumstances. ClassLoader oldClassLoader=Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(Check_License_Servlet.class.getClassLoader()); XMLEncoder encoder=new XMLEncoder(os); encoder.setExceptionListener(new ExceptionListener() { public void exceptionThrown(Exception e) { e.printStackTrace(); }}); encoder.writeObject(o); encoder.flush(); encoder.close(); Thread.currentThread().setContextClassLoader(oldClassLoader); } private static ByteArrayOutputStream writeOutputStream=new ByteArrayOutputStream(16384); /** Writes an object to XML. * @param out The boject out to write to. [ Will not be closed. ] * @param o The object to write. */ public static synchronized void writeAsXML(ObjectOutput out,Object o) throws IOException { writeOutputStream.reset(); writeXMLObject(writeOutputStream,o); byte[] Bt_1=writeOutputStream.toByteArray(); byte[] Bt_2=new Des_Encrypter().encrypt(Bt_1,Key); out.writeInt(Bt_2.length); out.write(Bt_2); out.flush(); out.close(); } public static synchronized void Write_Serialized_XML(OutputStream Output_Stream,Object o) throws IOException { writeAsXML(new ObjectOutputStream(Output_Stream),o); } At the receiving end the code look like this : File_Url="http://"+Site_Url+App_Dir+File_Name; try { Contact_Info_Entry Online_Contact_Entry=(Contact_Info_Entry)Read_Serialized_XML(new URL(File_Url)); } catch (Exception e) { e.printStackTrace(); } private static byte[] readBuf=new byte[16384]; public static synchronized Object readAsXML(ObjectInput in) throws IOException { // Classloader reference must be set since netBeans uses another class loader to load the bean which will fail under some circumstances. ClassLoader oldClassLoader=Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(Tool_Lib_Simple.class.getClassLoader()); int length=in.readInt(); readBuf=new byte[length]; in.readFully(readBuf,0,length); byte Bt[]=new Des_Encrypter().decrypt(readBuf,Key); XMLDecoder dec=new XMLDecoder(new ByteArrayInputStream(Bt,0,Bt.length)); Object o=dec.readObject(); Thread.currentThread().setContextClassLoader(oldClassLoader); in.close(); return o; } public static synchronized Object Read_Serialized_XML(URL File_Url) throws IOException { return readAsXML(new ObjectInputStream(File_Url.openStream())); } But I can't get the object from the Java app that's on the receiving end, why ? The error messages look like this : java.lang.ClassNotFoundException: PayPal_Monitor.Contact_Info_Entry Continuing ... java.lang.NullPointerException: target should not be null Continuing ... java.lang.NullPointerException: target should not be null Continuing ... java.lang.NullPointerException: target should not be null Continuing ...

    Read the article

  • PHP Menu Items More Button

    - by Adrian M.
    Hello, I use the bellow code to load the main menu elements from some CMS, the present code is perfect except that it loads ALL the main items on a single line of menu - which will make the width of it unusable in any centered design (under 1000px).. I want to change this script so after 15 main elements will add a "MORE" button under which the rest of the main menu items will show as sub-items of this "MORE" button (they will not have their own sub-items as the first 15 do).. How can I do it? Thanks! <?php require_once( '../../../inc/header.inc.php' ); require_once( DIRECTORY_PATH_INC . 'membership_levels.inc.php' ); require_once( DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/TemplMenu.php" ); class SimpleMenu extends TemplMenu { function getCode() { $this->iElementsCntInLine = 100; $this->getMenuInfo(); $this->genTopItems(); return $this->sCode; } function genTopItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID, $isBold = false, $sPicture = '') { $sActiveStyle = ($bActive) ? ' id="tm_active"' : ''; if (!$bActive) { $sAlt= $sOnclick ? ( ' alt="' . $sOnclick . '"' ) : ''; $sTarget = $sTarget ? ( ' target="_parent"' ) : ''; } $sLink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; $sSubMenu = $this->getAllSubMenus($iItemID); $sImgTabStyle = $sPictureRep = ''; if ($isBold && $sPicture != '') { $sPicturePath = getTemplateIcon($sPicture); $sPictureRep = "<img src='{$sPicturePath}' style='vertical-align:middle;width:16px;height:16px;' />"; $sText = '&nbsp;'; $sImgTabStyle = 'style="width:38px;"'; } $sMainSubs = ($sSubMenu=='') ? '' : " {$sSubMenu} </a>"; $this->sCode .= " <li><a href='{$sLink}' {$sOnclick} target='_parent'>{$sPictureRep}{$sText}</a> <div id='submenu'> <ul> <li>{$sMainSubs}</li> </ul> </div> </li> "; } } $objMenu = new SimpleMenu(); echo "<ul id='ddmenu'>"; echo $objMenu->getCode(); echo "</ul>"; ?>

    Read the article

  • PHP Menu Items Count then add under more button

    - by Adrian M.
    Hello, I use the bellow code to load the main menu elements from some CMS, the present code is perfect except that it loads ALL the main items on a single line of menu - which will make the width of it unusable in any centered design (under 1000px).. I want to change this script so after 15 main elements will add a "MORE" button under which the rest of the main menu items will show as sub-items of this "MORE" button (they will not have their own sub-items as the first 15 do).. How can I do it? Thanks! <?php require_once( '../../../inc/header.inc.php' ); require_once( DIRECTORY_PATH_INC . 'membership_levels.inc.php' ); require_once( DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/TemplMenu.php" ); class SimpleMenu extends TemplMenu { function getCode() { $this->iElementsCntInLine = 100; $this->getMenuInfo(); $this->genTopItems(); return $this->sCode; } function genTopItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID, $isBold = false, $sPicture = '') { $sActiveStyle = ($bActive) ? ' id="tm_active"' : ''; if (!$bActive) { $sAlt= $sOnclick ? ( ' alt="' . $sOnclick . '"' ) : ''; $sTarget = $sTarget ? ( ' target="_parent"' ) : ''; } $sLink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; $sSubMenu = $this->getAllSubMenus($iItemID); $sImgTabStyle = $sPictureRep = ''; if ($isBold && $sPicture != '') { $sPicturePath = getTemplateIcon($sPicture); $sPictureRep = "<img src='{$sPicturePath}' style='vertical-align:middle;width:16px;height:16px;' />"; $sText = '&nbsp;'; $sImgTabStyle = 'style="width:38px;"'; } $sMainSubs = ($sSubMenu=='') ? '' : " {$sSubMenu} </a>"; $this->sCode .= " <li><a href='{$sLink}' {$sOnclick} target='_parent'>{$sPictureRep}{$sText}</a> <div id='submenu'> <ul> <li>{$sMainSubs}</li> </ul> </div> </li> "; } } $objMenu = new SimpleMenu(); echo "<ul id='ddmenu'>"; echo $objMenu->getCode(); echo "</ul>"; ?>

    Read the article

  • Custom Items in Lists in C# forms?

    - by chaz
    I'm a bit new to the C#-form app developing and I want know, what's the best way around at making a control that holds a list of horizontal items. In which each of these items are horizontally ruled to it's parent control, contain a thumbnail to the left and a large text block to the right of image and a smaller text block underneath that. So basically this isn't a predefined control I can find in the toolbox. Any ideas?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >