Search Results

Search found 1712 results on 69 pages for 'respond with'.

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

  • UIButton does not respond to touch events after changing its position using setFrame

    - by Pranathi
    I have a view controller class (child) which extends from view controller class (parent). In the parent class's loadView() method I create a sub-view (named myButtonView) with two buttons (buttons are horizontally laid out in the subview) and add it to the main view. In the subclass I need to shift these two buttons up by 50pixels. So, I am shifting the buttonView by calling the setFrame method. This makes the buttons shift and render properly but they do not respond to touch events after this. Buttons work properly in the views of Parent class type. In the child class type view also, if I comment out the setFrame() call the buttons work properly. How can I shift the buttons and still make them respond to touch events? Any help is appreciated. Following is snippets of the code. In the parent class: - (void)loadView { // Some code... CGRect buttonFrameRect = CGRectMake(0,yOffset+1,screenRect.size.width,KButtonViewHeight); myButtonView = [[UIView alloc]initWithFrame:buttonFrameRect]; myButtonView.backgroundColor = [UIColor clearColor]; [self.view addSubview:myButtonView]; // some code... CGRect nxtButtonRect = CGRectMake(screenRect.size.width - 110, 5, 100, 40); myNxtButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myNxtButton setTitle:@"Submit" forState:UIControlStateNormal]; myNxtButton.frame = nxtButtonRect; myNxtButton.backgroundColor = [UIColor clearColor]; [myNxtButton addTarget:self action:@selector(nextButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myNxtButton]; CGRect backButtonRect = CGRectMake(10, 5, 100, 40); myBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myBackButton setTitle:@"Back" forState:UIControlStateNormal]; myBackButton.frame = backButtonRect; myBackButton.backgroundColor = [UIColor clearColor]; [myBackButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myBackButton]; // Some code... } In the child class: - (void)loadView { [super loadView]; //Some code .. CGRect buttonViewRect = myButtonView.frame; buttonViewRect.origin.y = yOffset; // This is basically original yOffset + 50 [myButtonView setFrame:buttonViewRect]; yOffset += KButtonViewHeight; // Add some other view below myButtonView .. }

    Read the article

  • What does WIX's CloseApplication functionality do and how would can the application respond to such

    - by tronda
    In the WIX setup I've got, when upgrading the application I have set a requirement to close down applications which might hold on to files which needs to be updated: <util:CloseApplication Id="CloseMyApp" Target="[MyAppExe]" CloseMessage="no" Description="!(loc.MyAppStillRunning)" RebootPrompt="no" ElevatedCloseMessage="no" /> The application on the other hand will capture closing down the window with a "user friendly" dialog box where the user can confirm that he or she wants to close down the application. I've experienced problems with the CloseApplication, and one theory is that the dialog box stops the application from closing. So the question is: Could this be a possible problem? If so - how can I have this confirmation dialog box and still behave properly when the installer asks the application to close down? Must I listen to Win32 messages (such as WM_QUIT/WM_CLOSE) or is there a .NET API which I can use to respond properly to these events?

    Read the article

  • Clearing "may not respond" warnings for UIView and UIViewController

    - by user284681
    In an iPad app, I'm using a custom subclass of UIView with UIViewController. Here's the view header: @interface pdfView : UIView { CGPDFDocumentRef doc; } -(void)setDoc:(CGPDFDocumentRef)newDoc; @end And here's the controller header: @interface iPadPDFTestViewController : UIViewController { CGPDFDocumentRef doc; } - (void)loadPDF; @end Part of the controller implementation: - (void)viewDidLoad { [super viewDidLoad]; [self loadPDF]; [self.view setDoc:doc]; } In Interface Builder, I've set the view object to use the class pdfView. At compilation, [self.view setDoc:doc]; gives the warning "'UIView' may not respond to '--setDoc'." I'm guessing that this warning appears because the compiler thinks it's looking at UIView (which does not implement the setDoc method) instead of pdfView. But why does it think that? And how can I tell it what class it's really looking at, so as to clear the warning?

    Read the article

  • "SecondViewController" may not respond to '-updatePlayerQueueWithMedia:' Messages without a matching

    - by Pavan
    I don't understand whats happening I get a warning that says "SecondViewController" may not respond to '-updatePlayerQueueWithMedia:' Messages without a matching signature will be assumed to return 'id' and accept '...' as arguments. this is my method - (void)mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { [self dismissModalViewControllerAnimated: YES]; [self updatePlayerQueueWithMediaCollection: mediaItemCollection]; } And the actual method which ive written in the same page is - (void) updatePlayerQueueWithMediaCollection: (MPMediaItemCollection *) mediaItemCollection { //and shit happens here. } I don't understand whats happening can someone please help me get rid of this warning.

    Read the article

  • NSNotification center may not respond to -object ?

    - by blackkettle
    Hi, I'm trying to make simple use of the NSNotification center inside my iPhone application, but I seem to be doing something wrong in this case. I was under the impression that it was possible to retrieve an object associated with a particular message, or at least a reference to the object, but using the following example code I'm getting a warning, "NSNotification center may not respond to -object" - (void)addNewBookmark:(NSNotificationCenter *)notification { Bookmark *newBookMark = (Bookmark *)[notification object]; //Do some stuff with the bookmark object } Indeed, when I compile and run the code, basically nothing I try to do with the contents of the object actually gets carried out - it's simply ignored. The post code is as follows, - (IBAction)save:(id) sender{ //Sending the message with the related object [[NSNotificationCenter defaultCenter] postNotificationName:@"addNewBookmark" object:bookmark]; } and the bookmark object itself is just a dictionary. I also tried using the "userInfo" argument and passing the bookmark object through that, but the result was the same. How should I be doing this? What am I doing wrong?

    Read the article

  • nth-child doesn't respond to class

    - by Arne Stephensson
    Is it possible to get the nth-child pseudo-selector to work with a specific class? See this example: http://jsfiddle.net/fZGvH/ I want to have the second DIV.red turn red, but it doesn't apply the color as expected. Not only that, but when you specify this, it changes the 5th DIV to red: div.red:nth-child(6) When you specify this, it changes the 8th DIV to red: div.red:nth-child(9) It seems to be one DIV behind. There are only 8 DIV tags in the example so I don't know why nth-child(9) even works. Testing using Firefox 3.6, but in my actual production code the same problem occurs in Chrome. I'm not understanding something about how this is supposed to work, would appreciate clarification. Also, this will change the 6th DIV to red, but what I actually want is for it to change the second DIV.red to red: div.red:nth-of-type(6) And I don't understand why nth-child() and nth-of-type() respond differently, since there are only eight tags of the same type in the document.

    Read the article

  • Making GridView Respond to 2 Drop Down Lists

    - by raziiq
    Hi there. I have got 2 Drop Down Lists on my Form and 1 GridView. I want GridView to display the data according to selection from the Drop Down Lists. For Example, One Drop Down List contains Names and other contains Dates. Both the Drop Down Lists can post back. So if i select a name from 1st Drop Down list, the Grid View should show all the results according to that Name. Similarly if i select the Date from the other Drop Down List , the Grid View should show the results according to the dates. But i cant figure out as how to bind Grid View to respond to 2 Drop Down List. BTW i am binding both the Drop Down Lists and the Grid View to the DataSource Objects, which is getting data from the database. Any Suggestions??

    Read the article

  • Buttons created through jquery don't respond to clicks

    - by Atrus
    As I've come to understand using $('.whatever').click() only works for items created initially. Additional items won't respond in the correct fashion. I was then directed to using something like $('.whatever).on('click', myFunction()). However, I'm not detecting any difference, as newly created items are not called. Here is a JSFiddle demonstration my example code: http://jsfiddle.net/atrus6/zaKZN/ My initial input plus 'Kill' will work in the correct fashion, however any additional 'input + kill's will not not do anything. Am I incorrectly using .on() or is it something else?

    Read the article

  • Delphi: How to respond to WM_SettingChange/WM_WinIniChange?

    - by Ian Boyd
    i need to know when my application recieves a WM_SETTINGCHANGE message (formerly known as WM_WININICHANGE). Problem is that the message pump in TApplication sends it down a black hole (default handler) before i can get a chance to see it: procedure TApplication.WndProc(var Message: TMessage); ... begin Message.Result := 0; for I := 0 to FWindowHooks.Count - 1 do if TWindowHook(FWindowHooks[I]^)(Message) then Exit; CheckIniChange(Message); with Message do case Msg of WM_SETTINGCHANGE: begin Mouse.SettingChanged(wParam); Default; <----------------------*poof* down the sink hole end; ... end; ... end; The procedure CheckIniChange() doesn't throw any event i can handle, neither does Mouse.SettingChanged(). And once the code path reaches Default, it is sent down the DefWindowProc drain hole, never to be seen again (since the first thing the WndProc does is set the Message.Result to zero. i was hoping to assign a handler to a TApplicationEvents.OnMessage event: procedure TdmGlobal.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin case Msg.message of WM_SETTINGCHANGE: begin // Code end; end; end; But the OnMessage event is only thrown for messages that come through the message pump. Since the WM_SETTINGCHANGE message is "handled", it never sees the PeekMessage TranslateMessage DispatchMessage system. How can i respond to the windows broadcast WM_SETTINGCHANGE?

    Read the article

  • ActiveScaffold custom action_link that should respond like update

    - by doug316
    I have a custom action link which is :inline and :post. It's a quick-link to update an attribute, and that part works just fine. After the action, my intent is to respond just like it was an update, so the row is re-rendered in the index. After the record is updated in my controller action, I call respond_to_action(:create) Just like in the create method in active scaffold. It seems like the content of the javascript response is returned correctly to the client, however, the problem: The content-type of the response header is "text/html" instead of "text/javascript", unlike with an actual update. So the JS is not executed and the row doesn't update. I can't figure out what the difference could possibly be here, I've traced extensively and even have replaced the respond_to_action with: respond_to do |format| format.js do render ... end end And it still won't set the content-type like every other action in the app. Anybody have a clue here? Something in active scaffold must be overriding the content-type and I can't figure out what it might be. Surprising this isn't documented, this doesn't seem like an unusual use-case, making an action a slave to the update re-render.

    Read the article

  • xcode may not respond to warning

    - by Frames84
    Hi all, Can't seem to get rid of a warning. The warning is: 'UIImage' may not respond to '-scaleToSize' above the @implmentation MyViewController I have this @implementation: @implementation UIImage (scale) -(UIImage*)scaleToSize:(CGSize)size { UIGraphicsBeginImageContext(size); [self drawInRect:CGRectMake(0, 0, size.width, size.height)]; UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return scaledImage; } @end Then I have MyViewController implementation @implementation TodayNewsTableViewController @synthesize dataList; ...... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MainNewsCellIdentifier = @"MainNewsCellIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: MainNewsCellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier: MainNewsCellIdentifier] autorelease]; } NSUInteger row = [indexPath row]; NSDictionary *stream = (NSDictionary *) [dataList objectAtIndex:row]; NSString *title = [stream valueForKey:@"title"]; if( ! [title isKindOfClass:[NSString class]] ) { cell.textLabel.text = @""; } else { cell.textLabel.text = title; } cell.textLabel.numberOfLines = 2; cell.textLabel.font =[UIFont systemFontOfSize:10]; cell.detailTextLabel.numberOfLines = 1; cell.detailTextLabel.font= [UIFont systemFontOfSize:8]; cell.detailTextLabel.text = [stream valueForKey:@"created"]; NSString *i = [NSString stringWithFormat:@"http://www.mywebsite.co.uk/images/%@", [stream valueForKey:@"image"]]; NSData *imageURL = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:i]]; UIImage *newsImage = [[UIImage alloc] initWithData:imageURL] ; UIImage *scaledImage = [newsImage scaleToSize:CGSizeMake(50.0f, 50.0f)]; // warning is appearing here. cell.imageView.image = scaledImage; [imageURL release]; [newsImage release]; return cell; } Thanks for your time in advance. Frames

    Read the article

  • My UITextView delegate method doesn't respond

    - by user611967
    Hi guys. I would like to start we that i'm not a very good english speaker, so excuse me if something is wrong. So I have this code header file : import @interface macViewController : UIViewController { UINavigationItem *navItem; UITextView *iTextView; } @property (nonatomic, retain) IBOutlet UINavigationItem *navItem; @property (nonatomic, retain) IBOutlet UITextView *iTextView; (IBAction) btnClicked; @end implementation file : import "macViewController.h" @implementation macViewController @synthesize navItem, iTextView; (IBAction) btnClicked { if (self.editing == YES) { self.editing = NO; [iTextView resignFirstResponder]; UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Data Saved" message:@"Your data was saved" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } else { self.editing = YES; [iTextView becomeFirstResponder]; } NSLog(@"works"); self.navItem.rightBarButtonItem = self.editButtonItem; self.navItem.rightBarButtonItem.action = @selector(btnClicked); } (void) textViewDidChangeUITextView *)textView { NSLog(@"works"); } So like you guess it's a view based app wich when i tap Edit button the keyboard pops-up then i press Done button and keyboard disappear and appear a alert view. SO I WANTED TO MAKE THEN I TOUCH THE TEXTVIEW, EDIT BUTTON TO BECOME DONE BUTTON ... THE PROBLEM IS THAT THE METHOD I DELEGATE TO IT DOESN'T RESPOND ... (USING CONSOLE I SAW THAT NOTHING HAPPENS) ... I TRIED DIFFERENT CODE BUT ALL = 0 ... PLEASE HELP I'M NEW ...

    Read the article

  • Why is the proper "respond_to" format not getting called?

    - by humble_coder
    Hi All, I'm having a bit of an odd issue. Really too odd to type out, but here goes. Basically I have a controller that refuses to "respond_to" using javascript unless I assign my "chart.generate_xml" to a variable before the "respond_to" block like so: @xml = @chart.generate_xml(@begin_date,@end_date,1.hour) respond_to do |format| format.html format.js{ render :update do |page| page.insert_html :bottom, "chart-div", @xml #page.insert_html :bottom, "chart-div", @chart.generate_xml(@begin_date,@end_date,1.hour) end } If I remove the upper "@xml= …" portion and go with the lower "page.insert", the "format.js" section doesn't get called. And if I try to force the format with "request.format = :js", I get the javascript returned as text. I'm not doing anything special here in that method call, so I'm not sure why it would choose to respond any differently. FWIW, the method that triggers this controller action is using JS to do so, so I'm confused as to why "format.js" isn't always getting called. Thoughts? Best.

    Read the article

  • UITextField in UIAlertView doesn't respond to cut/copy/paste on second showing

    - by Jesse Grosjean
    I"m adding a UITextView to a UIAlertView with the following code: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Enter Name Here" message:@"this gets covered!" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:@"OK!", nil]; UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)]; CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, 60); [alert setTransform:myTransform]; [myTextField setBackgroundColor:[UIColor whiteColor]]; [alert addSubview:myTextField]; [alert show]; [alert release]; [myTextField release]; If I place that code in a standard action method: - (IBAction)testAlertView:(id)sender { ...the above code... } Then the first time I show the alert view the cut/copy/paste popup menu will show in the text fields that's been added to the alert view. (For instance if I tap and hold, then "Paste" will popup after I release. The problem is after working correctly the first time, none of the cut/copy/paste buttons will show up again when I show the alert view unless I restart the app. Does anyone know why, or how to fix this problem? Bonus information I just found out that I can get things to always work if I create an show the alert within a UIActionSheet delagate callback. For instance this always works (cut/copy/paste always shows up when in the UITextField when appropriate) - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { ...the above code... } Any idea what might be happening in this second case that make things work? I don't want to use a UIActionSheet in my app, so I'd like to find a way to make it work from a plain old action method. Thanks, Jesse

    Read the article

  • UITextField in UIAlertView doesn't respond to cut/copy/paste on second showing

    - by Jesse Grosjean
    Edit Reposting... I accidentally marked my previous question as "commuity wiki" and didn't realize that answers to wiki posts don't generate reputation. I"m adding a UITextView to a UIAlertView with the following code: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Enter Name Here" message:@"this gets covered!" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:@"OK!", nil]; UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)]; CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, 60); [alert setTransform:myTransform]; [myTextField setBackgroundColor:[UIColor whiteColor]]; [alert addSubview:myTextField]; [alert show]; [alert release]; [myTextField release]; If I place that code in a standard action method: (IBAction)testAlertView:(id)sender { ...the above code... } Then the first time I show the UIAlertView the cut/copy/paste popup menu will show in UITextField that's been added to the UIAlertView. (For instance if I tap and hold, then "Paste" will popup after I release. The problem is after working correctly the first time, none of the cut/copy/paste buttons will show up again next time I show the UIAlertView (new instance) unless I restart the app. Does anyone know why, or how to fix this problem? Bonus information I just found out that I can get things to always work if I create an show the alert within a UIActionSheet delagate callback. For instance this always works (cut/copy/paste always shows up when in the UITextField when appropriate) (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { ...the above code... } Any idea what might be happening in this second case that make things work? I don't want to use a UIActionSheet in my app, so I'd like to find a way to make it work from a plain old action method. Thanks, Jesse

    Read the article

  • Modify the filter chain - Or select servlet to respond to request using filter

    - by klonq
    I am trying to use a filter to map requests. I am trying to do this for two reasons, firstly to dynamically generate URI's and have them mapped to the appropriate servlet and secondly to catch URI's which are not registered and handle them appropriately. So I'm using a catch-all filter to process the URI and determine the response. I would like some way of modifying the filter chain, or some way to set the servlet which responds to the request from within the filter. I have been unsuccessful using filterConfig.getServletContext().getRequestDispatcher().forward() to send to jsp, ideally though I would like to map to a servlet but can't figure out how. The reason I am not doing this from within a servlet is that I have some URIs which are fixed within web.xml and if I use a catch-all servlet those URIs do not get mapped. Is this possible, is it clean or it going to get really messy?

    Read the article

  • Flash makes Firefox not to respond

    - by Hasan Gürsoy
    I have a full screen flash animation. When this page is open at Firefox and I want to minimize or re-size Firefox screen minimize button starts to blink and Firefox does not take any action till this tab is closed. There is not too much code in the flash file.

    Read the article

  • NSWindow does not respond to keystroke command-s

    - by wackazong
    Hello, it may pre very simple, but cannot find it: I have three windows in three separate NIBs in my application. One is opened when a new document is opened, the other two can be opened from the program's window menu. The problem is: two windows (in them the one that is opened at the beginning) accepts the normal keystroke as for example command-s for save, and the other one does not and gives a warning sound instead. I cannot figure out the difference between the two windows or their controllers. I know it will have to do with the responder chain, but I am left clueless. Any ideas? Thanks, wackazong

    Read the article

  • Convert flyout menu to respond onclick vs mouseover

    - by Scott B
    The code below creates a nifty flyout menu action on a nested list item sequence. The client has called and wants the change the default behavior in which the flyouts are triggered by mouseover, so that you have to click to trigger a flyout. Ideally, I would just like to modify this code so that you click on a small icon (plus/minus) that sits to the right of the menu item if it has child menus. Can someone give me a bit of guidance on what bits I'd need to change to accomplish this? /* a few sniffs to circumvent known browser bugs */ var sUserAgent = navigator.userAgent.toLowerCase(); var isIE=document.all?true:false; var isNS4=document.layers?true:false; var isOp=(sUserAgent.indexOf('opera')!=-1)?true:false; var isMac=(sUserAgent.indexOf('mac')!=-1)?true:false; var isMoz=(sUserAgent.indexOf('mozilla/5')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var isNS6=(sUserAgent.indexOf('netscape6')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var dom=document.getElementById?true:false; /* sets time until menus disappear in milliseconds */ var iMenuTimeout=1500; var aMenus=new Array; var oMenuTimeout; var iMainMenusLength=0; /* the following boolean controls the z-index property if needed */ /* if is only necessary if you have multiple mainMenus in one file that are overlapping */ /* set bSetZIndeces to true (either here or in the HTML) and the main menus will have a z-index set in descending order so that preceding ones can overlap */ /* the integer iStartZIndexAt controls z-index of the first main menu */ var bSetZIndeces=true; var iStartZIndexAt=1000; var aMainMenus=new Array; /* load up the submenus */ function loadMenus(){ if(!dom)return; var aLists=document.getElementsByTagName('ul'); for(var i=0;i<aLists.length;i++){ if(aLists[i].className=='navMenu')aMenus[aMenus.length]=aLists[i]; } var aAnchors=document.getElementsByTagName('a'); var aItems = new Array; for(var i=0;i<aAnchors.length;i++){ // if(aAnchors[i].className=='navItem')aItems[aItems.length] = aAnchors[i]; aItems[aItems.length] = aAnchors[i]; } var sMenuId=null; var oParentMenu=null; var aAllElements=document.body.getElementsByTagName("*"); if(isIE)aAllElements=document.body.all; /* loop through navItem and navMenus and dynamically assign their IDs */ /* each relies on it's parent's ID being set before it */ for(var i=0;i<aAllElements.length;i++){ if(aAllElements[i].className.indexOf('x8menus')!=-1){ /* load up main menus collection */ if(bSetZIndeces)aMainMenus[aMainMenus.length]=aAllElements[i]; } // if(aAllElements[i].className=='navItem'){ if(aAllElements[i].tagName=='A'){ oParentMenu = aAllElements[i].parentNode.parentNode; if(!oParentMenu.childMenus) oParentMenu.childMenus = new Array; oParentMenu.childMenus[oParentMenu.childMenus.length]=aAllElements[i]; if(aAllElements[i].id==''){ if(oParentMenu.className=='x8menus'){ aAllElements[i].id='navItem_'+iMainMenusLength; //alert(aAllElements[i].id); iMainMenusLength++; }else{ aAllElements[i].id=oParentMenu.id.replace('Menu','Item')+'.'+oParentMenu.childMenus.length; } } } else if(aAllElements[i].className=='navMenu'){ oParentItem = aAllElements[i].parentNode.firstChild; aAllElements[i].id = oParentItem.id.replace('Item','Menu'); } } /* dynamically set z-indeces of main menus so they won't underlap */ for(var i=aMainMenus.length-1;i>=0;i--){ aMainMenus[i].style.zIndex=iStartZIndexAt-i; } /* set menu item properties */ for(var i=0;i<aItems.length;i++){ sMenuId=aItems[i].id; sMenuId='navMenu_'+sMenuId.substring(8,sMenuId.lastIndexOf('.')); /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aItems[i].onmouseover=function(){modClass(true,this,"activeItem");window.clearTimeout(oMenuTimeout);showMenu("'+sMenuId+'");};'); eval('aItems[i].onmouseout=function(){modClass(false,this,"activeItem");window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); eval('aItems[i].onfocus=function(){this.onmouseover();}'); eval('aItems[i].onblur=function(){this.onmouseout();}'); //aItems[i].addEventListener("keydown",function(){keyNav(this,event);},false); } var sCatId=0; var oItem; for(var i=0;i<aMenus.length;i++){ /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aMenus[i].onmouseover=function(){window.clearTimeout(oMenuTimeout);}'); eval('aMenus[i].onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); sCatId=aMenus[i].id; sCatId=sCatId.substring(8,sCatId.length); oItem=document.getElementById('navItem_'+sCatId); if(oItem){ if(!isOp && !(isMac && isIE) && oItem.parentNode)modClass(true,oItem.parentNode,"hasSubMenu"); else modClass(true,oItem,"hasSubMenu"); /* assign event handlers */ eval('oItem.onmouseover=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); eval('oItem.onfocus=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onblur=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); //oItem.addEventListener("keydown",function(){keyNav(this,event);},false); } } } /* this will append the loadMenus function to any previously assigned window.onload event */ /* if you reassign this onload event, you'll need to include this or execute it after all the menus are loaded */ function newOnload(){ if(typeof previousOnload=='function')previousOnload(); loadMenus(); } var previousOnload; if(window.onload!=null)previousOnload=window.onload; window.onload=newOnload; /* show menu and hide all others except ancestors of the current menu */ function showMenu(sWhich){ var oWhich=document.getElementById(sWhich); if(!oWhich){ hideMenu('all'); return; } var aRootMenus=new Array; aRootMenus[0]=sWhich var sCurrentRoot=sWhich; var bHasParentMenu=false; if(sCurrentRoot.indexOf('.')!=-1){ bHasParentMenu=true; } /* make array of this menu and ancestors so we know which to leave exposed */ /* ex. from ID string "navMenu_12.3.7.4", extracts menu levels ["12.3.7.4", "12.3.7", "12.3", "12"] */ while(bHasParentMenu){ if(sCurrentRoot.indexOf('.')==-1)bHasParentMenu=false; aRootMenus[aRootMenus.length]=sCurrentRoot; sCurrentRoot=sCurrentRoot.substring(0,sCurrentRoot.lastIndexOf('.')); } for(var i=0;i<aMenus.length;i++){ var bIsRoot=false; for(var j=0;j<aRootMenus.length;j++){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(aMenus[i].id==aRootMenus[j])bIsRoot=true; } if(bIsRoot && oThisItem)modClass(true,oThisItem,'hasSubMenuActive'); else modClass(false,oThisItem,'hasSubMenuActive'); if(!bIsRoot && aMenus[i].id!=sWhich)modClass(false,aMenus[i],'showMenu'); } modClass(true,oWhich,'showMenu'); var oItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oItem)modClass(true,oItem,'hasSubMenuActive'); } function hideMenu(sWhich){ if(sWhich=='all'){ /* loop backwards b/c WinIE6 has a bug with hiding display of an element when it's parent is already hidden */ for(var i=aMenus.length-1;i>=0;i--){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); modClass(false,aMenus[i],'showMenu'); } }else{ var oWhich=document.getElementById(sWhich); if(oWhich)modClass(false,oWhich,'showMenu'); var oThisItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); } } /* add or remove element className */ function modClass(bAdd,oElement,sClassName){ if(bAdd){/* add class */ if(oElement.className.indexOf(sClassName)==-1)oElement.className+=' '+sClassName; }else{/* remove class */ if(oElement.className.indexOf(sClassName)!=-1){ if(oElement.className.indexOf(' '+sClassName)!=-1)oElement.className=oElement.className.replace(' '+sClassName,''); else oElement.className=oElement.className.replace(sClassName,''); } } return oElement.className; /* return new className */ } //document.body.addEventListener("keydown",function(){keyNav(event);},true); function setBubble(oEvent){ oEvent.bubbles = true; } function keyNav(oElement,oEvent){ alert(oEvent.keyCode); window.status=oEvent.keyCode; return false; }

    Read the article

  • Android Respond To URL in Intent

    - by Isaac Waller
    I want my intent to be launched when the user goes to a certain url: for example, the android market does this with http://market.android.com/ urls. so does youtube. I want mine to do that too. If anybody could explain this, thank you very much. Isaac Waller

    Read the article

  • Why flash makes Firefox not to respond

    - by Hasan Gürsoy
    I have a full page flash animation. When this page is open at Firefox and I want to minimize or re-size Firefox screen, minimize button starts to blink and Firefox does not take any action till this tab is closed. There is not too much code in the flash file. What can cause this? Also this could not be related with full page. I saw other flash files doing same thing. As I remember same problem at Daily Motion. When trying to switch tab nothing happens till I stop video or close the tab.

    Read the article

  • C# Windows Forms Print Dialog box click OK twice to respond

    - by sbartlett007
    I'm using Visual Studio 2008, .net Framework 3.5 for a Windows forms client-server app that I'm working on. There is a weird bug when I run the program and try to print. The print dialog box opens, but I have to click the OK button twice for it to work. After the second click it works fine, no errors. When I put a breakpoint on: if (result == DialogResult.OK) , the breakpoint doesn't trigger until the second click. Here is the code: private void tbPrint_Click(object sender, EventArgs e) { try { printDialog1.Document = pDoc; DialogResult result = printDialog1.ShowDialog(); if (result == DialogResult.OK) { pDoc.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PrinterName; pDoc.Print(); } ... This is driving me crazy, and I can't see anything else that would interfere with it.

    Read the article

  • Safari Extension - How to respond to Settings changes?

    - by Martin Marlow
    Hi, I'm currently working on an Extension for Safari 5 and I want to run a listener function whenever Settings changes are made. Apple provides an example for that, but it doesn't work for me. I currently have this listener function in my global html file: function numberChanged() { if(event.key == "number") alert("Number has changed!"); } safari.self.addEventListener("change", numberChanged, false); I hope somebody can help me. Does somebody know what I'm doing wrong?

    Read the article

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