Search Results

Search found 28682 results on 1148 pages for 'drop down menu'.

Page 111/1148 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • Which trick uses Apple to show icons in the dock contextual menu ?

    - by Matthieu Riegler
    My question is quite simple : To use a custom menu for the apps icon on the dock, - (NSMenu*) applicationDockMenu: (id) sender; of the NSApplicationDelegate has to return the menu that the dock will display. Using setImage on a NSMenuItem, you can normaly add icons to the menu. They show up on the normal menu, but not on in contextual menu of the app's dock icon. Then how did Apple manage QuickTime, XCode, Preview to show icons in the list of recent opened files accessible in their dock contextual menu ? Thx.

    Read the article

  • ModX navigation menu with "wayfinder" snippet

    - by user1219432
    I have a main navigation at the top of the site. And a subnavigation at left of my site. For example: At the top there are these topics: Cars | Trees | Jobs | ... So when you click on "Jobs" there should be the subnavigation of "Jobs" at left, like... Construction Jobs Engineering Jobs Retail Jobs ... The first (top) navigation is easy to achieve: [[!Wayfinder? &startId=0 &level=1 ]] How can I realize the second navigation, so that only the documents are listed that are under the parent document?

    Read the article

  • Refactoring two methods down to one

    - by bflemi3
    I have two methods that almost do the same thing. They get a List<XmlNode> based on state OR state and schoolType and then return a distinct, ordered IEnumerable<KeyValuePair<string,string>>. I know they can be refactored but I'm struggling to determine what type the parameter should be for the linq statement in the return of the method (the last line of each method). I thank you for your help in advance. private IEnumerable<KeyValuePair<string, string>> getAreaDropDownDataSource() { StateInfoXmlDocument stateInfoXmlDocument = new StateInfoXmlDocument(); string schoolTypeXmlPath = string.Format(STATE_AND_SCHOOL_TYPE_XML_PATH, StateOfInterest, ConnectionsLearningSchoolType); var schoolNodes = new List<XmlNode>(stateInfoXmlDocument.SelectNodes(schoolTypeXmlPath).Cast<XmlNode>()); return schoolNodes.Select(x => new KeyValuePair<string, string>(x.Attributes["idLocation"].Value, x.Value)).OrderBy(x => x.Key).Distinct(); } private IEnumerable<KeyValuePair<string, string>> getStateOfInterestDropDownDataSource() { StateInfoXmlDocument stateInfoXmlDocument = new StateInfoXmlDocument(); string schoolTypeXmlPath = string.Format(SCHOOL_TYPE_XML_PATH, ConnectionsLearningSchoolType); var schoolNodes = new List<XmlNode>(stateInfoXmlDocument.SelectNodes(schoolTypeXmlPath).Cast<XmlNode>()); return schoolNodes.Select(x => new KeyValuePair<string, string>(x.Attributes["stateCode"].Value, x.Attributes["stateName"].Value)).OrderBy(x => x.Key).Distinct(); }

    Read the article

  • Simplify my menu animation code

    - by zaius
    I've got a bunch of 'project' divs that I want to expand when they're clicked on. If there's already a project open, I want to hide it before I slide out the new one. I also want to stop clicks on an already open project from closing and then opening it again. Here's an example of what I mean (warning - wrote the code in the browser): $('.projects').click(function() { var clicked_project = $(this); if (clicked_project.is(':visible')) { clicked_project.height(10).slideUp(); return; } var visible_projects = $('.projects:visible'); if (visible_projects.size() > 0) { visible_projects.height(10).slideUp(function() { clicked_project.slideDown(); }); } else { clicked_project.slideDown(); } }); Really, my big issue is with the second part - it sucks that I have to use that if/else - I should just be able to make the callback run instantly if there aren't any visible_projects. I would think this would be a pretty common task, and I'm sure there's a simplification I'm missing. Any suggestions appreciated!

    Read the article

  • Cutting down repeating code in c# Class

    - by Tom Gullen
    This is a wrapper for an API I'm working on, am I doing it sort of right? I'm not particularly fond of all the repeating code in the constructor, if someone can show me if I can reduce that it would be very helpful! public class WebWizForumVersion { // Properties of returned data public string Software { get; private set; } public string Version { get; private set; } public string APIVersion { get; private set; } public string Copyright { get; private set; } public string BoardName { get; private set; } public string URL { get; private set; } public string Email { get; private set; } public string Database { get; private set; } public string InstallationID { get; private set; } public bool NewsPad { get; private set; } public string NewsPadURL { get; private set; } public WebWizForumVersion(XmlReader Data) { try { Data.ReadToFollowing("Software"); this.Software = Data.ReadElementContentAsString(); Data.ReadToFollowing("Version"); this.Version = Data.ReadElementContentAsString(); Data.ReadToFollowing("ApiVersion"); this.APIVersion = Data.ReadElementContentAsString(); Data.ReadToFollowing("Copyright"); this.Copyright = Data.ReadElementContentAsString(); Data.ReadToFollowing("BoardName"); this.BoardName = Data.ReadElementContentAsString(); Data.ReadToFollowing("URL"); this.URL = Data.ReadElementContentAsString(); Data.ReadToFollowing("Email"); this.Email = Data.ReadElementContentAsString(); Data.ReadToFollowing("Database"); this.Database = Data.ReadElementContentAsString(); Data.ReadToFollowing("InstallID"); this.InstallationID = Data.ReadElementContentAsString(); Data.ReadToFollowing("NewsPad"); this.NewsPad = bool.Parse(Data.ReadElementContentAsString()); Data.ReadToFollowing("NewsPadURL"); this.NewsPadURL = Data.ReadElementContentAsString(); } catch (Exception e) { } } }

    Read the article

  • HTML anchor #bottom, only going half-way down page

    - by RewbieNewbie
    http://www.planet-tolkien.com/board/44/621/0/poll-suggestions It's due to the multiple "bottom of the page" anchor links on each post to the anchor name at the bottom of the page. I tried to solve this by using a unique id and name for the attributes: <a href="#bottom" id="4656" name="4656"> But this hasn't worked. Suggestions? P.S. Don't use the URL bar, yes that works. Visit the page and click on a link in a post that says "Bottom of the page". This is where it isn't working.

    Read the article

  • Embedded YouTube video slows down page load

    - by Tom S
    Hi, total newbie here - trying to figure out how to make a page load faster with 1 embedded YouTube video on it - a very modest page takes an extra 5 seconds to completely load with the YouTube player showing up. I'd either like the page to load first or to only load the video when user clicks on it - don't know how to do that.. Here is the YouTube video embed code: <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/kfZIIKVfJ1w&hl=en_US&fs=1&rel=0&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kfZIIKVfJ1w&hl=en_US&fs=1&rel=0&hd=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> Thanks for your help!

    Read the article

  • OSX: Programmatically added subviews not responding to mouse down events

    - by BigCola
    I have 3 subclasses: a Block class, a Row class and a Table class. All are subclasses of NSView. I have a Table added with IB which programmatically displays 8 rows, each of which displays 8 blocks. I overrode the mouseDown: method in Block to change the background color to red, but it doesn't work. Still if I add a block directly on top of the Table with IB it does work so I can't understand why it won't work in the first case. Here's the implementation code for Block and Row (Table's implementation works the same way as Row's): //block.m - (void)drawRect:(NSRect)dirtyRect { [color set]; [NSBezierPath fillRect:dirtyRect]; } -(void)mouseDown:(NSEvent *)theEvent { color = [NSColor redColor]; checked = YES; [self setNeedsDisplay:YES]; } //row.m - (void)drawRect:(NSRect)dirtyRect { [[NSColor blueColor] set]; [NSBezierPath fillRect:dirtyRect]; int x; for(x=0; x<8; x++){ int margin = x*2; NSRect rect = NSMakeRect(0, 50*x+margin, 50, 50); Block *block = [[Block alloc] initWithFrame:rect]; [self addSubview:block]; } }

    Read the article

  • Drawing lines between windows just like in Interface Builder

    - by Koning Baard
    I have two windows, each with a round NSView: ------------------ ------------ |X-+ Oscillator | |X-+ Mixer | |----------------| |----------| | | | | | O | | O | | | | | | | | | ------------------ ------------ Both windows are in a seperate NIB. I want to be able to draw a line between the two round NSViews at runtime, using drag'n'drop, just like connecting IBOutlets in Interface Builder: ------------------ ------------ |X-+ Oscillator | |X-+ Mixer | |----------------| |----------| | | | | | O-------+-----+-----O | | | | | | | | | ------------------ ------------ I also want to be able to determine to which NSViews the NSViews are connected using the drawn lines. I need this to connect Oscillators to Mixers. I also want to be able to remove the connections by dragging into empty space. Can anyone explain me how to do this? Thanks.

    Read the article

  • Wordpress Menu item

    - by kwek-kwek
    I have a main page that has a children item. Now my question is, is it possible to have the Main page link directly to the children item in it? E.g. -Main Page(links to Page 2) ---Page 2 Here is my code: <div id="MainNav"> <ul> <?php wp_list_pages('exclude=3&sort_column=menu_order&title_li=&depth=1'); ?> </ul> </div> <div id="leftCol"> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } else { ?> <?php } ?> </div>

    Read the article

  • jQuery Nested Droppables

    - by John
    I have a nested set of jQuery droppables...one outer droppable that encompasses most of the page and an a set of nested inner droppables on the page. The functionality I want is: If a draggable is dropped outside of any of the inner droppables it should be accepted by the outer droppable. If a draggable is dropped onto any of the inner droppables it should NOT be accepted by the outer droppable, regardless of whether the inner droppable accepts the draggable. So that would be easy if I could guarantee 1+ inner droppables would accept the draggable, because the greedy attribute would make sure it would only get triggered once. Unfortunately the majority of the time the inner droppable will also reject the draggable, meaning the greedy option doesn't really help. Summary: The basic functionality is a set of valid/invalid inner droppables to accept the draggable, but when you toss the draggable outside any of the draggables it gets destroyed by the outer droppable. What's the best way of doing this?

    Read the article

  • Javascript for removing menu and scroll bars

    - by nWight
    Hi - I have this script on my html page: parent.resizeTo(550,510); I'd like to add to it so it positions the window in the middle of the screen. Also, I want to remove the address and tool bars (I've managed to hide the scrollbars by using body{overflow:hidden;}). I know how to do this using JS upon opening a new window from the browser but this needs to work from clicking a link on a PDF. Does anyone have any suggestions? Thank you!

    Read the article

  • Mysql slowing down my application

    - by user2985991
    my application is taking ages to load because of my database isnt located on my computer.. Anyone have any idea to how improve my performance? public Form1() { Splash splash = new Splash(); splash.Show(); InitializeComponent(); Load(); public void Load() { db.SelectTeam(); db.SelectMatches(); } On db.SelectTeam and SelectMatches I get everything I need from mysql and put into lists... Sorry if it's confusing, but I don't know what to do, and sorry for my bad english EDIT: Here are the querys string query = "SELECT * FROM teams ORDER BY name"; string query = "SELECT * FROM matches ORDER BY date ASC";

    Read the article

  • How to make this jQuery snippet work in Internet Explorer?

    - by George Edison
    If there was ever a time to hate IE, this is it. This code begins with a box with content. When the button is clicked, the box is supposed to drop down and fade-in. <html> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript'> function Test() { var item_height = $('#test').height(); $('#test').height(0); $('#test').css('opacity','0'); $('#test').animate({ height: item_height, opacity: '1' },400); } </script> <body> <!-- The div below holds the sample content --> <div id="test" style='border: 1px solid black;'> Content<br> Content<br> Content<br> Content<br> Content </div> <!-- The button to test the animation --> <br><br> <div style='position: absolute; top: 150px; left: 10px;'> <button onclick='Test();'>Test</button> </div> </body> </html> This very simple example works on Chrome, Safari, and Opera. But Internet Explorer? No. How can I (if it's even possible) fix this so that it works in IE?

    Read the article

  • Telerik window automatically opens after every page refresh

    - by CSharpDev4Evr
    I am using Telerik RadControls in my project and and have a menu where I have an 'About' button. When I click the 'About' button a window pops up describing the application. The problem is if I refresh the page or navigate to another page then back to the first page the window automatically pops up. The goal is only have that window pop up when the user clicks the about button. here is the code I used to get that window: <!--About Window--> <telerik:RadWindowManager runat="server" EnableViewState="false" KeepInScreenBounds="true"></telerik:RadWindowManager> <telerik:RadWindow ID="AboutMenu" Behaviors="Close" Animation="None" runat="server" Width="360px" KeepInScreenBounds="true" Height="360px" Modal="true" VisibleStatusbar="false" Skin="Glow"> <ContentTemplate> <p style="text-align: center;">Sample Window Information</p> </ContentTemplate> </telerik:RadWindow> Javascript function OnClientItemClick(sender, eventArgs) { if (window.args.get_item().get_text() == "About") { var radwindow = window.$find(window.AboutMenu.ClientID); window.args.set_cancel(true); } } .cs protected void MainMenu_OnItemClick(object sender, RadMenuEventArgs e) { if (e.Item.Text == "About") { AboutMenu.VisibleOnPageLoad = true; } } The window works but it loads whenever the page loads and thats where I think the line AboutMenu.VisibleOnPageLoad = true comes into play and is causing the error but when I take out that line it won't display at all.

    Read the article

  • Can't call function from within onOptionsItemSelected

    - by Kristy Welsh
    public boolean onOptionsItemSelected(MenuItem item) { //check selected menu item switch (item.getItemId()) { case R.id.exit: this.finish(); return true; case R.id.basic: Difficulty = DIFFICULTY_BASIC; Toast.makeText(YogaPosesActivity.this, "Difficulty is Basic", Toast.LENGTH_SHORT).show(); SetImageView(myDbHelper); return true; case R.id.advanced: Toast.makeText(YogaPosesActivity.this, "Difficulty is Advanced", Toast.LENGTH_SHORT).show(); Difficulty = DIFFICULTY_ADVANCED; SetImageView(myDbHelper); return true; case R.id.allPoses: Toast.makeText(YogaPosesActivity.this, "All Poses Will Be Displayed", Toast.LENGTH_SHORT).show(); Difficulty = DIFFICULTY_ADVANCED_AND_BASIC; SetImageView(myDbHelper); return true; default: return super.onOptionsItemSelected(item); } } I get an error when I call the SetImageView function, which was defined out of the OnCreate Activity. Can you not call a function unless it was defined inside the OnCreate? I get a nullPointer Exception when calling the function.

    Read the article

  • 12.04 home encrypted and I have written down encryption passphrase. How to reset login password?

    - by Stevie
    I set up a friend with 12.04 and he forgot his password. I encrypted his home directory and I have written down the encryption passphrase during the first boot. If he changed his password after I wrote down the encryption passphrase during the first boot is this original encryption passphrase of any use? What should I do to reset or recover his password and keep everything accessible and functionally intact with the encrypted home directory?

    Read the article

  • Drag and Drop-How to get the url's title?, Name? Description? (2 replies)

    I made a .Hta file that contains some drag and drop (primitive coding, alas). (see full .hta code at bottom of this posting) The .hta returns the url of links that are dragged and dropped onto it. But there's info it doesn't return that I need, and I don't know the right term to describe what I need that I'm not getting. To explain by example, if I open a window to this url: http://dotcommunities....

    Read the article

  • Drag and Drop-How to get the url's title?, Name? Description? (2 replies)

    I made a .Hta file that contains some drag and drop (primitive coding, alas). (see full .hta code at bottom of this posting) The .hta returns the url of links that are dragged and dropped onto it. But there's info it doesn't return that I need, and I don't know the right term to describe what I need that I'm not getting. To explain by example, if I open a window to this url: http://dotcommunities....

    Read the article

  • How to open new view (call an activity) from options menu defined in XML? (android)

    - by Portablejim
    I cant seem to open a new view from an options menu item. The program keeps crashing as it applies the intent and listener to the item. I am just beginning, so please be nice. The current view is mnfsms, and the view I am trying to open is mnfsms_settings. I am developing for 1.5. Could someone please help me get the menu working. The menu (called options_menu.xml): <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/settings_button" android:title="Settings" android:icon="@android:drawable/ic_menu_preferences" /> <item android:id="@+id/about_button" android:title="About" android:icon="@android:drawable/ic_menu_myplaces" /> </menu> The main view (called mnfsms.java): package com.example.mnfsms; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; public class mnfsms extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /* OnClickListener myocl = new View.OnClickListener() { public void onClick(View v){ Intent myi = new Intent(mnfsms.this, mnfsms_settings.class); startActivity(myi); } };*/ } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options_menu, menu); MenuItem mi_settings = (MenuItem)findViewById(R.id.settings_button); mi_settings.setIntent(new Intent(this, mnfsms_settings.class)); return true; } } The manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mnfsms" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".mnfsms" android:label="@string/main_window_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".mnfsms_settings" android:label="string/main_window_name"> </activity> </application> <uses-sdk android:minSdkVersion="3" /> </manifest> The stacktrace: 01-06 15:07:58.045: ERROR/AndroidRuntime(2123): Uncaught handler: thread main exiting due to uncaught exception 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): java.lang.NullPointerException 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.example.mnfsms.mnfsms.onCreateOptionsMenu(mnfsms.java:30) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.app.Activity.onCreatePanelMenu(Activity.java:2038) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:421) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:664) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:1278) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1735) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2188) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2158) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.handleMessage(ViewRoot.java:1490) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.os.Handler.dispatchMessage(Handler.java:99) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.os.Looper.loop(Looper.java:123) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.app.ActivityThread.main(ActivityThread.java:3948) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at java.lang.reflect.Method.invokeNative(Native Method) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at java.lang.reflect.Method.invoke(Method.java:521) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Placing a window near the system tray

    - by user227990
    I am writing a program that needs to set a window just above/below the traybar for gtk. I have tried using the 2 approaches that failed. One was using the gtk_status_icon_position_menu function and placing the window in the point where the user clicks (in the tray bar). The problem is that these solutions work in gnome(Linux) but not in Windows. In Linux they work because the window manager doesn't seem to allow placement of windows in the tray panel, honoring the closest possible. In Windows this doesn't happen and the window can go "out" of the screen which understandably is not desired. With this said i went out for a work around. My idea was to set the window in the location of mouse click and get the x and y coordinates of a normal window placement and with it's size check if it would be within the screen boundaries. If it was not make the correction. I have came up with the functions needed but for some reason the gdk_drawable_get_size(window-window ,&WindowWidth, &WindowHeight) and other similar functions only give the correct size value after the second run of the signal function. The result of the first run is just 1 to both size and width. (I have read the issue of X11 not giving correct results, but i think this is not it) event_button = (GdkEventButton *) event; if (event_button->button == 1) { if (active == 0) { gboolean dummy; gint WindowHeight, WindowWidth, WindowPosition[2]; GdkScreen *screen; gint ScreenHeight, ScreenWidth; dummy = FALSE; gtk_widget_show_all(window); gtk_window_present(GTK_WINDOW(window)); gtk_status_icon_position_menu(menu, &pos[X], &pos[Y], &dummy, statusicon); gtk_window_move(GTK_WINDOW(window), pos[X],pos[Y]); gdk_drawable_get_size(window->window ,&WindowWidth, &WindowHeight); screen = gtk_status_icon_get_screen(statusicon); ScreenWidth = gdk_screen_get_width(screen); ScreenHeight = gdk_screen_get_height(screen); g_print("Screen: %d, %d\nGeometry: %d, %d\n",ScreenWidth, ScreenHeight, WindowWidth, window->allocation.height); gtk_entry_set_text(GTK_ENTRY(entry),""); active = 1; return TRUE; } How can i do what i want in a portable way?

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >