Search Results

Search found 11001 results on 441 pages for 'native drag drop'.

Page 125/441 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Java Dragging an object from one area to another [on hold]

    - by user50369
    Hello I have a game where you drag bits of food around the screen. I want to be able to click on an ingredient and drag it to another part of the screen where I release the mouse. I am new to java so I do not really know how to do this please help me Here is me code. This is the class with the mouse listeners in it: public void mousePressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { Comp.ml = true; // placing if (manager.title == true) { if (title.r.contains(Comp.mx, Comp.my)) { title.overview = true; } else if (title.r1.contains(Comp.mx, Comp.my)) { title.options = true; } else if (title.r2.contains(Comp.mx, Comp.my)) { System.exit(0); } } if (manager.option == true) { optionsMouse(e); } mouseinventory(e); } else if (e.getButton() == MouseEvent.BUTTON3) { Comp.mr = true; } } private void mouseinventory(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { } else if (e.getButton() == MouseEvent.BUTTON1) { } } @Override public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { Comp.ml = false; } else if (e.getButton() == MouseEvent.BUTTON3) { Comp.mr = false; } } @Override public void mouseDragged(MouseEvent e) { for(int i = 0; i < overview.im.ing.toArray().length; i ++){ if(overview.im.ing.get(i).r.contains(Comp.mx,Comp.my)){ overview.im.ing.get(i).newx = Comp.mx; overview.im.ing.get(i).newy = Comp.my; overview.im.ing.get(i).dragged = true; }else{ overview.im.ing.get(i).dragged = false; } } } @Override public void mouseMoved(MouseEvent e) { Comp.mx = e.getX(); Comp.my = e.getY(); // System.out.println("" + Comp.my); } This is the class called ingredient public abstract class Ingrediant { public int x,y,id,lastx,lasty,newx,newy; public boolean removed = false,dragged = false; public int width; public int height; public Rectangle r = new Rectangle(x,y,width,height); public Ingrediant(){ r = new Rectangle(x,y,width,height); } public abstract void tick(); public abstract void render(Graphics g); } and this is a class which extends ingredient called hagleave public class HagLeave extends Ingrediant { private Image img; public HagLeave(int x, int y, int id) { this.x = x; this.y = y; this.newx = x; this.newy = y; this.id = id; width = 75; height = 75; r = new Rectangle(x,y,width,height); } public void tick() { r = new Rectangle(x,y,width,height); if(!dragged){ x = newx; y = newy; } } public void render(Graphics g) { ImageIcon i2 = new ImageIcon("res/ingrediants/hagleave.png"); img = i2.getImage(); g.drawImage(img, x, y, null); g.setColor(Color.red); g.drawRect(r.x, r.y, r.width, r.height); } } The arraylist is in a class called ingrediantManager: public class IngrediantsManager { public ArrayList<Ingrediant> ing = new ArrayList<Ingrediant>(); public IngrediantsManager(){ ing.add(new HagLeave(100,200,1)); ing.add(new PigHair(70,300,2)); ing.add(new GiantsToe(100,400,3)); } public void tick(){ for(int i = 0; i < ing.toArray().length; i ++){ ing.get(i).tick(); if(ing.get(i).removed){ ing.remove(i); i--; } } } public void render(Graphics g){ for(int i = 0; i < ing.toArray().length; i ++){ ing.get(i).render(g); } } }

    Read the article

  • HTML, JavaScript, and CSS in a NetBeans Platform Application

    - by Geertjan
    I broke down the code I used yesterday, to its absolute bare minimum, and then realized I'm not using HTML 5 at all: <html> <head> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <script type="text/javascript" src="script.js"></script> </head> <body> <div id="logo"> </div> <div id="infobox"> <h2 id="statustext"/> </div> </body> </html> Here's the script.js file referred to above: $(function(){ var banana = $("#logo"); var statustext = $("#statustext"); var defaulttxt = "Drag the banana!"; var dragtxt = "Dragging the banana!"; statustext.text(defaulttxt); banana.draggable({ drag: function(event, ui){ statustext.text(dragtxt); }, stop: function(event, ui){ statustext.text(defaulttxt); } }); }); And here's the stylesheet: body { background:#3B4D61 repeat 0 0; margin:0; padding:0; } h2 { color:#D1D8DF; display:block; font:bold 15px/10px Tahoma, Helvetica, Arial, Sans-Serif; text-align:center; } #infobox { position:absolute; width:300px; bottom:20px; left:50%; margin-left:-150px; padding:0 20px; background:rgba(0,0,0,0.5); -webkit-border-radius:15px; -moz-border-radius:15px; border-radius:15px; z-index:999; } #logo { position:absolute; width:450px; height:150px; top:40%; left: 30%; background:url(bananas.png) no-repeat 0 0; cursor:move; z-index:700; } However, I've replaced the content of the HTML file with a few of the samples from here, without any problem; in other words, if the HTML 5 canvas were to be needed, it could seamlessly be incorporated into my NetBeans Platform application: https://developer.mozilla.org/en/Canvas_tutorial/Basic_usage

    Read the article

  • jQuery live draggable / live droppable?

    - by Henk
    Hi all, Basically there are two tables: Companies and visitors. Currently it's possible to drag visitors to companies. Works great. As soon as the drop function occurs, there are two $.post's. The first one saves the drag to the database. The second one updates the visitors, because the information constantly changes. The problem, however is that as soon as the second $.post finishes, Firebug keeps popping the following error: d(this).data("draggable") is null Which occurs in the jQuery UI file. On line 56. about 400 times or so. So basically I'm looking for a way to do live() with draggable and droppable. The .draggables are in #visitors (an ul). The droppables are in #companies (a table). Thanks! $(".draggable").draggable({ revert:true }); $(".droppable").droppable({ drop: function(ev, ui) { $(this).text($(ui.draggable).text()); $.post('planning/save_visit', {user_id: $(ui.draggable).attr('id'), company_id: $(this).attr('id'), period: $('ul.periods li.active').attr('id')}); $.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){ $('#visitors').html(data); }); }, hoverClass: 'drophover' });

    Read the article

  • jquery nested sortable list

    - by Y.G.J
    i have this code $(document).ready(function() { $("#test-list").sortable({ items: "> li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); $("#test-sub").sortable({ containment: "ul", items: "li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); }); for this kind of UL <ul id="test-list"> <li></li> <li> <ul id="test-sub"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </li> <li></li> <li></li> <li></li> <li></li> </ul> but it can be changed dynamiclly... when i drag and drop the main li it is working when i do it with the childs it will drag the main one what is wrong?

    Read the article

  • RIA IDE - Visual Studio 2010, FlashBuilder and ExtJS Designer

    - by Ronaldo Junior
    I've been playing around with Flex4 - the trial version - and is really quite good in terms of layout development - since I'm starting a new RIA project and we still on the "what platform" phase I better listen what you guys have to say. In Flashbuilder I can do the layout and mix with the back end script code really fast - the version 4 give me the power to even test the functionality of the server side script, etc and since I can use Fllashbuilder as a Eclipse plugin, I end up with only one IDE. On the other hand, with Silverlight, it looks like if I want a "drag and drop" approach to build my interface I would need Expression Blend and Visual Studio (full or express version). Is there a way out that? I mean, Visual Studio 2010 will come with some sort of Silverlight component palet so that you can easily drag and drop it on your interface like you would do with WPF, etc? I don't wanna use Blend - is way too much for what we need - taking the "coding XAML" by hand is out of question as well. A third approach is to use ExtJS - they have a new designer IDE that looks promising.

    Read the article

  • Problem with header files of ARToolkitPlus after making the ARToolKitPlus dylib!

    - by MNassar
    I'm writing this Augmented Reality app for the iPhone and I'd decided to use ARToolKitPlus for it. Using QMake, I created the xcode project file and subsequently the libArToolKitPlus.dylib I tried to compile and run the sample files "simple" and "multi" which worked well. Now all other attempts that I tried to create another project and use the library have failed due to header files not being found. If I drag the "include" folder to the xcode project I get 8 errors instead of just one; The one is for the main include not being found is solved but then it includes 8 other headers that cannot be found (although they are in the same folder) #include "ARToolKitPlus/TrackerSingleMarkerImpl.h" I get a error: ARToolKitPlus/TrackerSingleMarkerImpl.h: No such file or directory If I drag the include folder then some of what I get: error: ARToolKitPlus/TrackerSingleMarker.h: No such file or directory error: ../src/TrackerSingleMarkerImpl.cpp: No such file or directory error: expected class-name before ',' token class TrackerSingleMarkerImpl : public TrackerSingleMarker, protected TrackerImpl<__PATTERN_SIZE_X,__PATTERN_SIZE_Y, __PATTERN_SAMPLE_NUM, __MAX_LOAD_PATTERNS, __MAX_IMAGE_PATTERNS Having the dylib doesnt make a difference as far as I can tell. What do you think I should do?? Would creating a framework help??

    Read the article

  • Scrolling with two fingers with a UIScrollView

    - by Craig
    I have an app where my main view accepts both touchesBegan and touchesMoved, and therefore takes in single finger touches, and drags. I want to implement a UIScrollView, and I have it working, but it overrides the drags, and therefore my contentView never receives them. I'd like to implement a UIScrollview, where a two finger drag indicates a scroll, and a one finger drag event gets passed to my content view, so it performs normally. Do I need create my own subclass of UIScrollView? Here's my code from my appDelegate where I implement the UIScrollView. @implementation MusicGridAppDelegate @synthesize window; @synthesize viewController; @synthesize scrollView; - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch //[application setStatusBarHidden:YES animated:NO]; //[window addSubview:viewController.view]; scrollView.contentSize = CGSizeMake(720, 480); scrollView.showsHorizontalScrollIndicator = YES; scrollView.showsVerticalScrollIndicator = YES; scrollView.delegate = self; [scrollView addSubview:viewController.view]; [window makeKeyAndVisible]; } - (void)dealloc { [viewController release]; [scrollView release]; [window release]; [super dealloc]; }

    Read the article

  • please clarify some aspects of AJAX with ASP.NET web forms for a beginner

    - by citrus
    Im familiar with asp.net web forms. I would now like to move on to writing web applications that use AJAX. I would like to get to the stage where I can create an app: that has "edit in place" (no page reload) where i can reorder images using drag and drop (also saves the order to DB) that has google like search suggestions while typing on the fly 1)So do I need to learn how to use AJAX.net and Jquery(my JS library of choice)? Can I make do using only AJAX.net or only Jquery? 2)As far a I know, Jquery will allow me to perform client side manipulations/actions and AJAX.net is the part that will allow me to connect some of my actions to the Server. EG. if I wanted to re-order elements using drag and drop, I would use Jquery, but in order to save the result of the re-order to the DB I would have to use AJAX.net correct? 2a)So In order to learn how to do the above Im thinking I should first learn Jquery so I know how to manipulate/ select elements, and then I can lean how to save these changes to the DB. 3)I searched the books titled "ASP.net AJAX in action" and ASP.net 3.5 AJAX, both of these books did not contain any references to "Jquery". Is this because they may be using a different JS library, or perhaps the book focuses on the AJAX user controls? I just found it confusing that 2 popular AJAX books dont make any reference to Jquery. Thanks for any help.

    Read the article

  • Firefox drags div like it was an image, javascript event handlers possibly to blame

    - by user281434
    Hi, I'm using this HTML,CSS and Javascript code (in one document together if you want to test it out): <style type="text/css"> #slider_container { width: 200px; height: 30px; background-color: red; display:block; } #slider { width: 20px; height: 30px; background-color: blue; display:block; position:absolute; left:0; } </style> <script type="text/javascript" src="../../js/libs/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#slider").mousedown(function() { $(document).mousemove(function(evnt) { $("#test").html("sliding"); }).mouseup(function() { $("#test").html("not sliding"); $(document).unbind("mousemove mouseup"); });}); }); </script> <div id="test">a</div> <div id="slider_container"> <div id="slider"></div> </div> Everything (surprisingly) works fine in IE, but firefox seems to totally clusterf*ck when this javascript is used. The first "slide" is okay, you drag, it says "sliding", you drop, it says "not sliding". On the second "slide" (or mousedown if you will), firefox suddenly thinks the div is an image or link and wants to drag it around. Screenshot of the dragging: http://i.imgur.com/nPJxZ.jpg Obviously the blue div half-positioned in the red div is the one being dragged. Windows does not capture the cursor when you take a screenshot, but it's a stop sign. Is there someway to prevent this default behaviour?

    Read the article

  • Image Wells, Core Data, and Sqlite files.

    - by Sway
    I've got a mac application that I've developed. I use it to create sqlite files that are bundled with my iphone app. The mac app uses Core Data and bindings and is working fine except for one "weird" issue. I use an NSImageView (or Image Well) to allow me to drag and drop jpg files. This is bound through to an optional binary attribute in my model class. For some reason when I drag and drop a 4k jpg file it onto the image well and save the sqlite file. The data saved to the binary column is over 15 times larger than it should be. Whereas if I use an application like SQLiteManager and add the image into the row in the database. The binary data is the correct (expected size). File 4k jpg Actual size: 2371. Persisted via Core Data size: 35810. Can anyone give me a suggestion as to why this might be happening? Do I need to set some setting in Interface Builder or write some custom code?

    Read the article

  • How to invalidate layout of listbox from custom children

    - by Stephen Price
    I have a custom panel for a listbox <ItemsPanelTemplate x:Key="FloatPanelTemplate"> <Controls:FloatPanel x:Name="CardPanel" /> </ItemsPanelTemplate> The panel lays out its children using its X and Y dependency properties. This all works nicely when the FloatPanel is used by itself - I'm using FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure on the dependency properties of the child items to tell the FloatPanel to redraw its layout. When I use it in a Listbox (code above) then it draws fine the first time, but when I drag the children (which modifies the item's X and Y) it is not notifying the Listbox that it needs to redraw the FloatPanel's children. I think the issue is related to the fact that each item in the bound collection is wrapped with a ListBoxItem. Hopefully I've described what i'm doing well enough that someone can tell me how to make the panel (or its children) tell it needs to do the Layout routines again. As I said it works once (initial draw) but then dragging items doesn't work (Listbox isnt aware that its children have changed and needs to relayout.) If I drag an item and then resize the window, the listbox does a layout and the items are drawn in their new locations. How do I notify the ListBox (or more importantly the FloatPanel in the ItemsPanelTemplate) that it needs to do a Layout pass?

    Read the article

  • Use of clone() and appendTo() with draggable - unexpected results with dragging

    - by Matt Gutting
    I'm constructing a UI for a doctor scheduling app. We have several doctors, each of whom can go in one of several locations on a scheduled day (M - F). I have the main day/location grid (table) in the center of the screen. At the left is a table for the doctor names. On loading, each table cell contains a span (outlined) with the doctor name. The doctor name can go in one slot for each day. I didn't want to just put 5 copies of the doctor name, because the doctor might not be available all 5 days of the week. The idea was: Drag the span and drop into the calendar table. On the drag "start" event, clone the span and append it to the table cell. Now there is another span ready to be dropped into the calendar table. One line of code does the work: $(ui.helper).clone(true).prependTo(ui.helper.parent()); This works. But when I move the cloned span, the original one moves in sync - preserving the spatial relationships as I move the clone around (no doubt there's a "position:relative;left=XX;top=YY" inserted somewhere). I'm sure there's a way to do what I'm thinking of, while keeping the two spans independent. But I'm not thinking of one. Does anyone have an idea? Thanks! Matt I posted this identical question to the jQuery forum as well.

    Read the article

  • Is NSPasteboard thread-safe?

    - by Joe
    Is it safe to write data to an NSPasteboard object from a background thread? I can't seem to find a definitive answer anywhere. I think the assumption is that the data will be written to the pasteboard before the drag begins. Background: I have an application that is fetching data from Evernote. When the application first loads, it gets the meta data for each note, but not the note content. The note stubs are then listed in an outline view. When the user starts to drag a note, the notes are passed to the background thread that handles getting the note content from Evernote. Having the main thread block until the data is gotten results in a significant delay and a poor user experience, so I have the [outlineView:writeItems:toPasteboard:] function return YES while the background thread processes the data and invokes the main thread to write the data to the pasteboard object. If the note content gets transferred before the user drops the note somewhere, everything works perfectly. If the user drops the note somewhere before the data has been processed... well, everything blocks forever. Is it safe to just have the background thread write the data to the pasteboard?

    Read the article

  • Parsing basic math equations for children's educational software?

    - by Simucal
    Inspired by a recent TED talk, I want to write a small piece of educational software. The researcher created little miniature computers in the shape of blocks called "Siftables". [David Merril, inventor - with Siftables in the background.] There were many applications he used the blocks in but my favorite was when each block was a number or basic operation symbol. You could then re-arrange the blocks of numbers or operation symbols in a line, and it would display an answer on another siftable block. So, I've decided I wanted to implemented a software version of "Math Siftables" on a limited scale as my final project for a CS course I'm taking. What is the generally accepted way for parsing and interpreting a string of math expressions, and if they are valid, perform the operation? Is this a case where I should implement a full parser/lexer? I would imagine interpreting basic math expressions would be a semi-common problem in computer science so I'm looking for the right way to approach this. For example, if my Math Siftable blocks where arranged like: [1] [+] [2] This would be a valid sequence and I would perform the necessary operation to arrive at "3". However, if the child were to drag several operation blocks together such as: [2] [\] [\] [5] It would obviously be invalid. Ultimately, I want to be able to parse and interpret any number of chains of operations with the blocks that the user can drag together. Can anyone explain to me or point me to resources for parsing basic math expressions? I'd prefer as much of a language agnostic answer as possible.

    Read the article

  • Saving NSBitmapImageRep as NSBMPFileType file. Wrong BMP headers and bitmap content

    - by niko34
    I save a NSBitmapImageRep to a BMP file (Snow Leopard). It seems ok when i open it on macos. But it makes an error on my multimedia device (which can show any BMP file from internet). I cannot figure out what is wrong, but when i look inside the file (with the cool hexfiend app on macos), 2 things wrong: the header have a wrong value for the biHeight parameter : 4294966216 (hex=C8FBFFFF) the header have a correct biWidth parameter : 1920 the first pixel in the bitmap content (after 54 bytes headers in BMP format) correspond to the upper left corner of the original image. In the original BMP file and as specified in the BMP format, it should be the down left corner pixel first. To explain the full workflow in my app, i have an NSImageView where i can drag a BMP image. This View is bind to an NSImage. After a drag & drop i have an action to save this image (with some text drawing over it) to a BMP file. Here's the code for saving the new BMP file : CGColorSpaceRefcolorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); CGContextRefcontext = CGBitmapContextCreate(NULL, (int)1920, (int)1080, 8, 4*(int)1920, colorSpace, kCGImageAlphaNoneSkipLast); [duneScreenViewdrawBackgroundWithDuneFolder:self inContext:context inRect:NSMakeRect(0,0,1920,1080) needScale:NO]; if(folderType==DXFolderTypeMovie) { [duneScreenViewdrawSynopsisContentWithDuneFolder:self inContext:context inRect:NSMakeRect(0,0,1920,1080) withScale:1.0]; } CGImageRef backgroundImageRef = CGBitmapContextCreateImage(context); NSBitmapImageRep*bitmapBackgroundImageRef = [[NSBitmapImageRepalloc] initWithCGImage:backgroundImageRef]; NSData*data = [destinationBitmap representationUsingType:NSBMPFileType properties:nil]; [data writeToFile:[NSStringstringWithFormat:@"%@/%@", folderPath,backgroundPath] atomically: YES]; The duneScreenViewdrawSynopsisContentWithDuneFolder method uses CGContextDrawImage to draw the image. The duneScreenViewdrawSynopsis method uses CoreText to draw some text in the same context. Do you know what's wrong?

    Read the article

  • stop propagarion from draggable div to selectable table

    - by Zeus
    If I have a table which has selectable cells $("#selectTable").selectable({ filter: ">*>tr>td"}); and one of the cells contains a draggable div $(".dragMe").draggable({}); HTML like so: <table id="selectTable"> <tr> <td> 1 </td> <td> 2 </td> <td> 3 </td> <td> <div class="dragMe">drag me</div> </td> </tr> </table> How do I stop the cell containing the div from being selectable? I presume the div will intercept the click event before the table cell, but my attempts at using event.stopPropagation on the draggable element have led me nowhere so far... Any suggestions or tips for using draggable inside a selectable parent would be most appreciated! EDIT: It seems that adding the div element to the cancel option for the selectable almost works - $("#selectTable").selectable({ filter: ">*>tr>td", cancel: ':input,option,div'}); this prevents the div from being selected when you click on it, but not when you drag+select it along with surrounding elements. Edit I've solved this now, the solution to this question can be found here

    Read the article

  • Want to show file association icon and skype like progress bar c#

    - by Thomas
    whenever user drag any file onto skype chat textbox then skype show right icon for that file and one custom progress bar rounded corner. i have 4 questions 1) i am working with win application not WPF. i like to know how to develop skype like corner progressbar. i search lot google to find out skype like progressbar. so if anyone knows how to develop that kind of progress bar then please share that knowledge or give me any url from where i can download similar look progressbar. 2) when i drag any file onto my richtextbox then how could i show right icon for that file on my richtextbox. anyone can give me idea. 3) what kind of richtextbox skype use? is there any advance richtextbox library which i can use for showing picture or button etc. 4) skype shows button on chat textbox called Cancel......is it button or any image. when user click on that button then button respond accordingly. so just tell me how could place any button on my rich textbox and when i will click on that button then a event should fire at my end. any idea. here i attach a picture from where you can see the image of progressbar that i am looking for. how i want to show the progress button and file associated icon on richtextbox. the object behind attaching the image is other person can understand what is my requirement and what i want to know. please anyone give me the idea for my above 4 points. thanks

    Read the article

  • ListView Final Column Autosize creates scrollbar

    - by Courtney de Lautour
    Hi There, I am implementing a custom control which derives from ListView. I would like for the final column to fill the remaining space (Quite a common task), I have gone about this via overriding the OnResize method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (Columns.Count == 0) return; Columns[Columns.Count - 1].Width = -2; // -2 = Fill remaining space } or via another method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (!_autoFillLastColumn) return; if (Columns.Count == 0) return; int TotalWidth = 0; int i = 0; for (; i < Columns.Count - 1; i++) { TotalWidth += Columns[i].Width; } Columns[i].Width = this.DisplayRectangle.Width - TotalWidth; } Edit: This works fine until I dock the ListView into a parent container and resize via that control. Every second time the control size shrinks (IE, drag the the border one pixel), I get a scroll bar on the bottom which can't move at all (not even one pixel). The result of which is when I drag the size of the parent I am left with a flickering scroll bar in the ListView, and a 50% chance it will be there when the dragging stops.

    Read the article

  • How do I get a ComboBox SelectionChanged event to fire from a nested ListBoxItem?

    - by Stephen McCusker
    This is a rather complex problem that has me really confused right now. Any help would be greatly appreciated. The Setup: ListBox of Type A UserControls -ListBoxItem of Type A UserControl --ListBox of Type B UserControls ---ListBoxItem of Type B UserControl ----ListBox of Type C UserControls -----ListBoxItem of Type C UserControl (contains the ComboBox) In other words, the Type A control has a ListBox of Type B controls that has a ListBox of Type C controls. All of the controls are hierarchical in nature. Type A contains the data that's needed to load the Type B controls and the Type B contains the data that's needed to load the Type C controls. The Type C control has a standard ComboBox in it for changing the values of the present items. In addition to the above structure, I have drag and dropping tied to the PreviewMouseLeftButtonDown event on both the Type A and Type B UserControl levels to handle reordering/deleting/etc commands in the GUI. All of this is working as intended. The Problem: When I attempt to change the value in the ComboBox, the SelectionChanged event never fires on the Type C "level" unless I'm careful enough to click on the borders/spacing in between any Type A or B controls. This happens when my ComboBox popout menu overlaps on either a Type A or B control located below itself. The selection events for Type A or B are firing instead of the Type C events, so the ComboBox is never changing its value reliably. In the debugger, the code for handling the drag and drop is triggering on the next ListBoxItem that's located underneath the ComboBox. Thoughts: Is there a way I can make my ComboBox popup take prevalence over the items behind it while double-nested in a ListBox (ie, ignore anything behind it while it's open)? Is there some way to reroute the incorrectly firing SelectionChanged events down to the ComboBox that's supposed to be triggering them?

    Read the article

  • Jquery draggable not working in chrome/safari

    - by jbatson
    I have created a page that uses ajax calls to load product images. The jquery code for drag, drop and clone would not work when in the index.php page so I moved it to the page that gets called to request the products as each product has drag, drop code created for it. Works fine in FF, even IE but not in Safari or Chrome. Below is the jquery code in load_products.php that gets created when the ajax call is made to load the products. http://tandyleatherfactory.net/ Anyone have any idea why wouldn't work in Safari? $(function() {$("#concho_4_2").draggable({ helper: 'clone', cursor: 'pointer', zIndex: '1001', stop: function(event, ui) { offsetElement = $(ui.helper).offset(); offNewContainer = $('#belts').offset(); var dataId = $(ui.helper).attr('id'); ajaxRequest('http://tandyleatherfactory.net/includes/ahah/add_product.php', 'product=4', '#conchos'); var randomnumber = Math.floor(Math.random()*1000000); var newId = 'concho_4_2_'+randomnumber; $(ui.helper).clone(true).removeAttr('id').attr('id',newId).css("left", offsetElement.left-offNewContainer.left-10).css("top", offsetElement.top-offNewContainer.top-10).appendTo('#belts'); $('#'+newId).draggable(); } });

    Read the article

  • Creating an application that can open files of a given format

    - by Brian Postow
    I've got an app, written in Obj-C. The info.plist has a list of file types that the app can open. I'm pretty sure that this is working because when I try to drag a file of an unacceptable type, the app doesn't highlight, but when I drag a file of an acceptable type, it does highlight, and lets me drop. When I drop, the app starts up, correctly, however, then I get a dialog saying: The document "foo.tiff" could not be opened. DocView cannot open files in the "TIFF File" format. I DO have this in my info.plist <key>CFBundleTypeExtensions</key> <array> <string>tif</string> <string>tiff</string> </array> <key>CFBundleTypeIconFile</key> <string>TIFFFile.icns</string> <key>CFBundleTypeName</key> <string>TIFF File</string> <key>CFBundleTypeOSTypes</key> <array> <string>TIFF</string> </array> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSHandlerRank</key> <string>Documents/</string> Thanks.

    Read the article

  • ASP.NET ListView, custom DataSources, and editing items

    - by Andrew Shepherd
    The MSDN walkthroughs provide a number of examples where you can drag a DataSource from the toolbox, run through some simple configuration steps, then drag a ListView onto the screen, point it at the DataSource, and hey - you've got full table editing. Now I'm trying to write my own DataSource class (a class that implements System.Web.UI.IDataSource) and my own DataSourceView class. I now assign an instance of this custom DataSource class to the ListView.DataSource propery. The display of all the items is working well. However, updating, inserting and deleting just is not working. I'm overriding every function I can in my DataSourceView class, and they just aren't being called. This is such a huge topic, I'll focus this question on one simple example: When you press the "Edit" button (the button inside the ItemTemplate with a CommandName of "Edit", you expect the ItemTemplate to be replaced by an EditItemTemplate. This did not happen. The only way I could get it to happen was to handle the onitemediting event. protected void _listViewPublicHolidays_ItemEditing(object sender, ListViewEditEventArgs e) { _listViewPublicHolidays.EditIndex = e.NewEditIndex; _listViewPublicHolidays.DataBind(); } This is hardly a problem, but how come I had to do it at all? In the MSDN walkthroughs where I attach a ListView to a LinqDataSource, this code doesn't have to be written. Can someone who's been here before hazard a guess as to what would be different or missing in my custom datasource?

    Read the article

  • ActionScript : Applying frame to a image / background?

    - by Jay
    I am editing a custom calendar application in flash. The purpose of this app is to let you select your own images, and create a calendar out of it. You can basically, drag and drop images of your choice and they apply frame/borders, or drag and drop embellishments. Here is the piece of code that draws a border/frame on the embellishment/image of your choice. tempListener.onLoadInit = function(target_mc:MovieClip) { var mcName = target_mc._name.substring(0, target_mc._name.indexOf("@", 0)); if(mcName == "frame_Image") { target_mc.onPress = function() { if(_root.selectedImage != null) { var index = this._name.substring(this._name.indexOf("@",0)+1, this._name.length); var objPath = nodesFrames.childNodes[index-1].attributes.image; if(_root.selectedImage._name.split("@")[0] == "image") { var mask = _root.selectedImage[_root.selectedImage._parent._name + "_" + _root.selectedImage._name + "_maskMc"]; frameImageWidth = mask._width; frameImageHeight = mask._height; frameImageXScale = -1; frameImageYScale = -1; } else { frameImageXScale = _root.selectedImage._xscale; frameImageYScale = _root.selectedImage._yscale; _root.selectedImage._xscale = 100; _root.selectedImage._yscale = 100; frameImageWidth = _root.selectedImage._width; frameImageHeight = _root.selectedImage._height; } if(_root.selectedImage["frame"]) {} else { _root.selectedImage.createEmptyMovieClip("frame", _root.selectedImage.getNextHighestDepth()); } var image_mcl1:MovieClipLoader = new MovieClipLoader(); image_mcl1.addListener(_root.mclFrameListener); image_mcl1.loadClip("Images/" + objPath, _root.selectedImage["frame"]); } } } I need to somehow apply the chosen frame image, to the entire background - not just to the embellishment or image. How do I go about this? Thanks in advance for your inputs. Please let me know if the question doesn't make sense, I will attach some images that can help you with the context.

    Read the article

  • Approaches to replace cursor in pure AS3 / Flare project?

    - by peteorpeter
    Hi there good lookin, I've got a pure AS3 (no Flex) project that uses Flare to display and interact with a data visualization. I just implemented some panning behavior, so you can click and drag the visualization around, and now I'd like to give the user a visual indicator that this is possible, by switching the arrow cursor with a nice grabby-looking hand icon. The user can click and drag at any time except when the mouse is over a clickable node (at which time the cursor swaps to a pointer - this behavior is already in place). So... 1) Do I need to create my own custom bitmap/sprite or is there a palette of built-in cursors I can use? (I'm not using Flex.) 2) Is there a way to simply replace the default arrow with the pan cursor project-wide, or do I need to attach the swapping to mouse events on display objects? Can I use the stage object to make this behavior apply everywhere? 3) How do I perform the swap? Do I use the Cursor object directly or do I need to get involved with the CursorManager? Any guidance, pseudo-code, or words of wisdom is greatly appreciated!

    Read the article

  • Problem using js jquery helper

    - by Josh R
    hi, I am using cakephp 1.3.6 and am trying to use inbuilt js helper. I have added var $helpers = array('Js' => array('Jquery')); in my controller. In my layout, I have included the jquery files and have also included echo $this->Js->writeBuffer(); before the </body> tag. I checked if the jquery libraries correctly but trying to create a simple accordian from the jqueryui.com, it works fine. But when I try <?php $this->Js->get('#element'); $this->Js->drag(array( 'container' => '#content', 'start' => 'onStart', 'drag' => 'onDrag', 'stop' => 'onStop', 'snapGrid' => array(10, 10), 'wrapCallbacks' => false )); ?> <div="element">something</div> It does not work. I appreciate any help. Thanks.

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >