Search Results

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

Page 41/441 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • IE7/IE8 javascript drop down menu used to redirect not working

    - by Robbiegod
    The error I see from IE7/IE8 in Jquery v1.7.2 and v.1.7.1 - i tried both: SCRIPT438: Object doesn't support property or method 'apply' My Code: <form> <select id="stateD" OnChange="showState()"> <option value="none" selected="selected">==========</option> <option value="http://www.google.com">google</option> <option value="http://www.yahoo.com">Yahoo</option> </select> </form> My Javascript - I have this pasted just below the webform: <script type="text/javascript"> function showState(){ oStates = document.getElementById("stateD"); var jLink = $("#stateD :selected").val(); if (jLink == undefined || jLink == "none" ){ alert("Please Select a State"); } else{ document.location.href=jLink}; } </script> I'm not using 2 libraries so i don't get why its having a problem. All that is supposed to happen is you select a url from the drop down menu and it auto sends you to that url that is in the value of the option tag. Works everywhere else, not sure why IE has to be such a jerk today. I'd post a url but i can't at the moment. its private. has anyone encountered this issue before?

    Read the article

  • CSS Drop Down Menu

    - by cvandal
    I'm trying to make a simple CSS drop down menu that when you mouse over a link, the sub menu appears. I've managed to achieve this when you mouse over an li but can't figure out how to do it using a link. The reason why I'm trying to do this using a link rather than the li is that my menu width is 100% and the li spans a greater area than the link so if you mouse over that area, the sub menu appears when you don't want it to. My CSS is as follows: .menu { border: solid 1px red; font-size: 5em; font-family: 'Raleway', arial, serif; } .menu ul { } .menu ul.children { display: none; } .menu ul li { margin: 20px 0 10px 0; } .menu ul li:hover ul.children { display: block; position: absolute; } .menu ul li a { padding: 10px 10px 0 40px; background: rgba(0,0,0,0.5); color: #fff; text-decoration: none; }

    Read the article

  • Modify php shopping cart to support multiple drop down menus

    - by Thomas
    I have a shopping cart script that I am trying to modify to support multiple product selection. As it is now, the customer can select a product from a single drop down menu. Now, I would like to add multiple dropdown menus (all populated with the same options). Here is the php that outputs the dropdown menu: if($eshopoptions['options_num']>1){ $opt=$eshopoptions['options_num']; $replace.="\n".'<label for="eopt'.$theid.'"><select id="eopt'.$theid.'" name="option">'; for($i=1;$i<=$opt;$i++){ $option=$eshop_product['products'][$i]['option']; $price=$eshop_product['products'][$i]['price']; if($option!=''){ if($price!='0.00') $replace.='<option value="'.$i.'">'.stripslashes(esc_attr($option)).' @ '.sprintf( _c('%1$s%2$s|1-currency symbol 2-amount','eshop'), $currsymbol, number_format($price,2)).'</option>'."\n"; else $replace.='<option value="'.$i.'">'.stripslashes(esc_attr($option)).'</option>'."\n"; } } Is there some really simple way of getting the code to output the menu say 3 times instead of once?

    Read the article

  • Javascript FAQ drop down

    - by kdipaolo
    Im trying to create a simple FAQ drop down but for some reason it is not working. Would you mind taking a look? Thanks guys! CSS #faqs h3 { cursor:pointer; } #faqs h3.active { color:#d74646; } #faqs div { height:0; overflow:hidden; position:relative; } #faqs div p { padding:0; margin-bottom:15px; } JavaScript: $(document).ready(function() { $('#faqs h3').each(function() { var tis = $(this), state = false, answer = tis.next('div') .hide() .css('height','auto') .slideUp(); tis.click(function() { state = !state; answer.slideToggle(state); tis.toggleClass('active',state); }); }); }); HTML <div id="faqs"> <h3>This is question 1?</h3> <div> <p>This is the answer to question #1.</p> </div> <h3>This is question 2?</h3> <div> <p>This is the answer to question #2.</p> </div> </div>

    Read the article

  • Make conversion to a native type explicit in C++

    - by Tal Pressman
    I'm trying to write a class that implements 64-bit ints for a compiler that doesn't support long long, to be used in existing code. Basically, I should be able to have a typedef somewhere that selects whether I want to use long long or my class, and everything else should compile and work. So, I obviously need conversion constructors from int, long, etc., and the respective conversion operators (casts) to those types. This seems to cause errors with arithmetic operators. With native types, the compiler "knows" that when operator*(int, char) is called, it should promote the char to int and call operator*(int, int) (rather than casting the int to char, for example). In my case it gets confused between the various built-in operators and the ones I created. It seems to me like if I could flag the conversion operators as explicit somehow, that it would solve the issue, but as far as I can tell the explicit keyword is only for constructors (and I can't make constructors for built-in types). So is there any way of marking the casts as explicit? Or am I barking up the wrong tree here and there's another way of solving this? Or maybe I'm just doing something else wrong...

    Read the article

  • How to drop/restart a client connection to a flaky socket server

    - by Steve Prior
    I've got Java code which makes requests via sockets from a server written in C++. The communication is simply that the java code writes a line for a request and the server then writes a line in response, but sometimes it seems that the server doesn't respond, so I've implemented an ExecutorService based timeout which tries to drop and restart the connection. To work with the connection I keep: Socket server; PrintWriter out; BufferedReader in; so setting up the connection is a matter of: server = new Socket(hostname, port); out = new PrintWriter(new OutputStreamWriter(server.getOutputStream())); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); If it weren't for the timeout code the request/receive steps are simply: String request="some request"; out.println(request); out.flush(); String response = in.readLine(); When I received a timeout I was trying to close the connection with: in.close(); out.close(); socket.close(); but one of these closes seems to block and never return. Can anyone give me a clue why one of these would block and what would be the proper way to abandon the connection and not end up with resource leak issues?

    Read the article

  • Modal QMessageBox does not behave like native Windows dialogs

    - by Philip Daubmeier
    My application has a dialog that asks the user via a QMessageBox whether he wants to discard all changes he made or wants to keep editing. I want this dialog to be modal to the whole application. I read somewhere that this is the standard behavior for a QMessageBox, so I dont have to set it explicitly with something like: mbox.setWindowModality(Qt::ApplicationModal); I wonder why it behaves differently from other modal dialogs in the OS (Windows 7 in my case). On the one hand it functions like it should, i.e. all other input methods in the application are blocked until the user answeres the dialog. However, it doesn't 'blink'* if the user clicks any other window of the application. Is there any way to get Qt to behave like a native Windows dialog? Thanks in advance! *If you don't know what I mean with this 'blinking': Just open notepad on a Windows OS, type some text and try to close it. A dialog pops up that asks to save, discard or keep editing. Now click somewhere on the editor window - the border and titlebar of the dialog flashes/blinks a few times.

    Read the article

  • NHibernate Native SQL multiple joins

    - by Chris
    Hi all, I"m having some problems with Nhibernate and native sql. I've got an entity with alot of collections and I am doing an SQL Fulltext search on it. So when returning 100 or so entities, I dont want all collections be lazy loaded. For this I changed my SQL query: SELECT Query.* FROM (SELECT {spr.*}, {adr.*}, {adrt.*}, {cty.*}, {com.*}, {comt.*}, spft.[Rank] AS [Rak], Row_number() OVER(ORDER BY spft.[Rank] DESC) AS rownum FROM customer spr INNER JOIN CONTAINSTABLE ( customerfulltext , computedfulltextindex , '" + parsedSearchTerm + @"' ) AS spft ON spr.customerid = spft.[Key] LEFT JOIN [Address] adr ON adr.customerid = spr.customerid INNER JOIN [AddressType] adrt ON adrt.addresstypeid = adr.addresstypeid INNER JOIN [City] cty ON cty.cityid = adr.cityid LEFT JOIN [Communication] com ON com.customerid = spr.customerid INNER JOIN [CommunicationType] comt ON comt.communicationtypeid = com.communicationtypeid) as Query ORDER BY Query.[Rank] DESC This is how I setup the query: var items = GetCurrentSession() .CreateSQLQuery(query) .AddEntity("spr", typeof(Customer)) .AddJoin("adr", "spr.addresses") .AddJoin("adrt", "adr.Type") .AddJoin("cty", "adr.City") .AddJoin("com", "spr.communicationItems") .AddJoin("comt", "com.Type") .List<Customer>(); What happens now is, that the query returns customers twice (or more), I assume this is because of the joins since for each customer address, communicationItem (e.g. phone, email), a new sql row is returned. In this case I thought I could use the DistinctRootEntityResultTransformer. var items = GetCurrentSession() .CreateSQLQuery(query) .AddEntity("spr", typeof(Customer)) .AddJoin("adr", "spr.addresses") .AddJoin("adrt", "adr.Type") .AddJoin("cty", "adr.City") .AddJoin("com", "spr.communicationItems") .AddJoin("comt", "com.Type") .SetResultTransformer(new DistinctRootEntityResultTransformer()) .List<Customer>(); Doing so an exception is thrown. This is because I try to list customers .List<Customer>() but the transformer returns only entities of the last join added. E.g. in the case above, the entity with alias "comt" is returned when doing .List() instead of .List(). If I would switch last join with the join alias "cty", then the transformer returns a list of cities only... Anyone knows how I can return a clean list of customers in this case?

    Read the article

  • Javascript drop down menu calculation

    - by Janis Yee
    I'm having a bit of an issue with me code. I'm trying to do a calculation from a drop down menu and then it will onChange to a textbox. I've been at it for days trying to figure it out and Googling ways to code the function. Can anyone please help or give me advice on how to approach this? function numGuest() { var a = document.getElementById("guests"); if(a.options[a.selectedIndex].value == "0") { registration.banq.value = "0"; } else if(a.options[a.selectedIndex].value == "1") { registration.banq.value = "30"; } } <select id="guests" name="guests"> <option value="0">0</option> <option value="1">1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> <input type="text" id="banq" name="banq" onChange="numGuest()" disabled />

    Read the article

  • Drop down menu going under #main div background in IE 7/8/9

    - by Adrift
    Here is the link to the domain http://linenwoods.com I am working on. I am going to fit the navigation list items on the header, but when the drop down menu is implemented I'm pretty sure it'll go under the #main div like you see currently. Is there any easy way fix to this? I couldn't find anything related to this from a google search .. was hoping someone could help me out. Below is the relevant CSS .. I tried playing around with z-index with no luck as I was told IE8 renders it strangely. If you have the time please follow the link with IE and leave a response .. I am trying to be as cross-browser compatible as possible and already am at a pretty pathetic start. Any help would be appreciated :) body { background-image:url('Background1.jpg'); background-position: center; height: 100%; margin: 0; padding: 0; opacity: 0.8; filter: alpha(opacity=80); } #main { width : 1010px; height: 1315px; background-color: white; margin-top: 15px; filter: alpha(opacity=80); } header { width: 1010px; height: 230px; background-color: white; margin: 0 auto; margin-top: 15px; filter: alpha(opacity=80); } footer { width: 1010px; height: 230px; background-color: white; margin: 15px 0 15px 0; filter: alpha(opacity=80); }

    Read the article

  • How can I revert a 'draggable' upon failed AJAX request?

    - by Frank
    I have a draggable div, that needs to be dropped on a droppable. If it is dropped correctly, the droppable calls an AJAX request. If the draggable does not have a valid id or the AJAX request fails, the draggable should be reverted to it's original position. Is that something that can be done with jQuery?! Any help is greatly appreciated!! $("div.draggable").livequery(function(){ $(this).draggable({ revert: 'invalid', distance: 20 }) }); $("#trash").droppable({ tolerance: 'touch', drop: function(event, ui) { var item = ui.draggable; var id = item.attr('id'); if (id) { $.ajax( { type: "POST", url: "delete.php", data: "id=" + id, success: function(html) { if (html) { item.remove(); } else { // FAILED AFTER AJAX // is it possible to revert the draggable from here?? } } }); } else { // FAILED BEFORE AJAX // is it possible to revert the draggable from here?? } } });

    Read the article

  • Using native MySQL driver in Erlang

    - by Mickey Shine
    I am using native MySQL driver (http://code.google.com/p/erlang-mysql-driver/) with mochiweb. When I tried that MySQL driver in shell mode, all woked fine. But when I write some code with Mochiweb, it reported me the following error: =CRASH REPORT==== 4-Jul-2009::04:44:29 === crasher: initial call: mochiweb_socket_server:acceptor_loop/1 pid: <0.61.0> registered_name: [] exception error: no function clause matching mysql:fetch(p1,<<"SELECT * FROM cdb_forums LIMIT 10">>) in function perly_web:loop/2 in call from mochiweb_http:headers/5 ancestors: [perly_web,perly_sup,<0.58.0>] messages: [] links: [<0.60.0>,#Port<0.965>] dictionary: [{mochiweb_request_body,undefined}, {mochiweb_request_qs,[]}, {mochiweb_request_post,[]}, {mochiweb_request_path,"/online"}, {mochiweb_request_cookie, [{"04c_sid","hG9Oyv"}, {"04c_visitedfid","2"}, {"kQx_cookietime","2592000"}, {"kQx_loginuser","admin"}, {"kQx_activationauth", "98b3mdX86fKT9dI4WyKuL61Tqxk%2BW1r6ACpHp9y8itH2xQ"}, {"smile","1D1"}]}] trap_exit: false status: running heap_size: 1597 stack_size: 24 reductions: 5188 neighbours: The code I write in Mochiweb is start(Options) -> {DocRoot, Options1} = get_option(docroot, Options), Loop = fun (Req) -> ?MODULE:loop(Req, DocRoot) end, % we’ll set our maximum to 1 million connections. (default: 2048) mochiweb_http:start([{max, 1000000}, {name, ?MODULE}, {loop, Loop} | Options1]), mysql:start_link(p1, "10.0.0.123", "root", "root", "test"). stop() -> mochiweb_http:stop(?MODULE). loop(Req, DocRoot) -> "/" ++ Path = Req:get(path), case Req:get(method) of Method when Method =:= 'GET'; Method =:= 'HEAD' -> case Path of "online" -> Result1 = mysql:fetch(p1, <<"SELECT * FROM cdb_forums LIMIT 10">>), Body1 = io:format("Result1: ~p~n", [Result1]), Req:ok({"text/plain", Body1}); The connection looks good but when I added Result1 = mysql:fetch(p1, <<"SELECT * FROM cdb_forums LIMIT 10">>), it crashed. Can someone help me? Thanks in advance~ //================================================== updated: I noticed the follwoing information. If that is correct? =PROGRESS REPORT==== 4-Jul-2009::05:49:32 === supervisor: {local,kernel_safe_sup} started: [{pid,<0.65.0>}, {name,inet_gethost_native_sup}, {mfa,{inet_gethost_native,start_link,[]}}, {restart_type,temporary}, {shutdown,1000}, {child_type,worker}] mysql_conn: greeting version "5.1.33-log" (protocol 10) salt "ne0_m'vA" caps 63487 serverchar <<8,2,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0>> salt2 "!|o;vabJ*4bt" mysql_auth send packet 1: <<5,162,0,0,64,66,15,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,114,111,111,116,0,20,52,235,78, 173,36,251,201,242,172,139,113,231,253,181,245,3, 91,198,111,135>> Link: {ok,<0.62.0>} =SUPERVISOR REPORT==== 4-Jul-2009::05:49:32 === Supervisor: {local,perly_sup} Context: start_error Reason: ok Offender: [{pid,undefined}, {name,perly_web}, {mfa, {perly_web,start, [[{ip,"0.0.0.0"}, {port,8000}, {docroot, "/work/mochiweb-read-only/scripts/perly/priv/www"}]]}}, {restart_type,permanent}, {shutdown,5000}, {child_type,worker}]

    Read the article

  • Why does PostgresQL query performance drop over time, but restored when rebuilding index

    - by Jim Rush
    According to this page in the manual, indexes don't need to be maintained. However, we are running with a PostgresQL table that has a continuous rate of updates, deletes and inserts that over time (a few days) sees a significant query degradation. If we delete and recreate the index, query performance is restored. We are using out of the box settings. The table in our test is currently starting out empty and grows to half a million rows. It has a fairly large row (lots of text fields). We are search is based of an index, not the primary key (I've confirmed the index is being used, at least under normal conditions) The table is being used as a persistent store for a single process. Using PostgresQL on Windows with a Java client I'm willing to give up insert and update performance to keep up the query performance. We are considering rearchitecting the application so that data is spread across various dynamic tables in a manner that allows us to drop and rebuild indexes periodically without impacting the application. However, as always, there is a time crunch to get this to work and I suspect we are missing something basic in our configuration or usage. We have considered forcing vacuuming and rebuild to run at certain times, but I suspect the locking period for such an action would cause our query to block. This may be an option, but there are some real-time (windows of 3-5 seconds) implications that require other changes in our code. Additional information: Table and index CREATE TABLE icl_contacts ( id bigint NOT NULL, campaignfqname character varying(255) NOT NULL, currentstate character(16) NOT NULL, xmlscheduledtime character(23) NOT NULL, ... 25 or so other fields. Most of them fixed or varying character fiel ... CONSTRAINT icl_contacts_pkey PRIMARY KEY (id) ) WITH (OIDS=FALSE); ALTER TABLE icl_contacts OWNER TO postgres; CREATE INDEX icl_contacts_idx ON icl_contacts USING btree (xmlscheduledtime, currentstate, campaignfqname); Analyze: Limit (cost=0.00..3792.10 rows=750 width=32) (actual time=48.922..59.601 rows=750 loops=1) - Index Scan using icl_contacts_idx on icl_contacts (cost=0.00..934580.47 rows=184841 width=32) (actual time=48.909..55.961 rows=750 loops=1) Index Cond: ((xmlscheduledtime < '2010-05-20T13:00:00.000'::bpchar) AND (currentstate = 'SCHEDULED'::bpchar) AND ((campaignfqname)::text = '.main.ee45692a-6113-43cb-9257-7b6bf65f0c3e'::text)) And, yes, I am aware there there are a variety of things we could do to normalize and improve the design of this table. Some of these options may be available to us. My focus in this question is about understanding how PostgresQL is managing the index and query over time (understand why, not just fix). If it were to be done over or significantly refactored, there would be a lot of changes.

    Read the article

  • python object to native c++ pointer

    - by Lodle
    Im toying around with the idea to use python as an embedded scripting language for a project im working on and have got most things working. However i cant seem to be able to convert a python extended object back into a native c++ pointer. So this is my class: class CGEGameModeBase { public: virtual void FunctionCall()=0; virtual const char* StringReturn()=0; }; class CGEPYGameMode : public CGEGameModeBase, public boost::python::wrapper<CGEPYGameMode> { public: virtual void FunctionCall() { if (override f = this->get_override("FunctionCall")) f(); } virtual const char* StringReturn() { if (override f = this->get_override("StringReturn")) return f(); return "FAILED TO CALL"; } }; Boost wrapping: BOOST_PYTHON_MODULE(GEGameMode) { class_<CGEGameModeBase, boost::noncopyable>("CGEGameModeBase", no_init); class_<CGEPYGameMode, bases<CGEGameModeBase> >("CGEPYGameMode", no_init) .def("FunctionCall", &CGEPYGameMode::FunctionCall) .def("StringReturn", &CGEPYGameMode::StringReturn); } and the python code: import GEGameMode def Ident(): return "Alpha" def NewGamePlay(): return "NewAlpha" def NewAlpha(): import GEGameMode import GEUtil class Alpha(GEGameMode.CGEPYGameMode): def __init__(self): print "Made new Alpha!" def FunctionCall(self): GEUtil.Msg("This is function test Alpha!") def StringReturn(self): return "This is return test Alpha!" return Alpha() Now i can call the first to functions fine by doing this: const char* ident = extract< const char* >( GetLocalDict()["Ident"]() ); const char* newgameplay = extract< const char* >( GetLocalDict()["NewGamePlay"]() ); printf("Loading Script: %s\n", ident); CGEPYGameMode* m_pGameMode = extract< CGEPYGameMode* >( GetLocalDict()[newgameplay]() ); However when i try and convert the Alpha class back to its base class (last line above) i get an boost error: TypeError: No registered converter was able to extract a C++ pointer to type class CGEPYGameMode from this Python object of type Alpha I have done alot of searching on the net but cant work out how to convert the Alpha object into its base class pointer. I could leave it as an object but rather have it as a pointer so some non python aware code can use it. Any ideas?

    Read the article

  • ASP.NET Drop Down list , the button function not firing after the first click

    - by Pinu
    ASP.Net Dropdownlist , on changing the value of drop down list and clicking the button it is not sending an upadted value to the New.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test_DropDown.aspx.cs" Inherits="Test_DropDown" % <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="ddl_test" runat="server" OnSelectedIndexChanged="ddl_test_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem>First Item</asp:ListItem> <asp:ListItem>Second Item</asp:ListItem> <asp:ListItem>Third Item</asp:ListItem> </asp:DropDownList> <asp:HiddenField ID="hdf_ddl" runat="server" /> <asp:Button ID="btn_test" runat="server" Text="Button" OnClick="Button1_Click" /> </div> </form> </body> </html> using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Test_DropDown : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string passValue = ddl_test.SelectedValue.ToString(); string val = hdf_ddl.Value.ToString(); btn_test.Attributes.Add("onclick", "window.open('New.aspx?ddlValue=" + val + "', 'OpenPopWindow','left=250,top=100,width=500,height=500,toolbar=1,resizable=0,status=0,menubar=0,scrollbars=1');return false;"); //btn_test.OnClientClick = "window.open('New.aspx?ddlValue=" + val + "', 'OpenPopWindow','left=250,top=100,width=500,height=500,toolbar=1,resizable=0,status=0,menubar=0,scrollbars=1');return false;"; } protected void ddl_test_SelectedIndexChanged(object sender, EventArgs e) { hdf_ddl.Value = ddl_test.SelectedValue.ToString(); } }

    Read the article

  • UIScrollView only works if the child views aren't hit

    - by dny238
    I have a scroll view that doesn't scroll right, I've simplified the code for below. It draws the view and some horizontal buttons that i add more stuff to in the real code. If you drag the whitespace between the buttons the view scrolls. If you happen to put your finger on a button, it won't scroll. After a related suggestion, I tried to add the delaysContentTouches = YES line, but it doesn't seem to make a difference. http://stackoverflow.com/questions/650437/iphone-uiscrollview-with-uibuttons-how-to-recreate-springboard What am I doing wrong? TIA, Rob Updated the code - (void)viewDidLoad { l = [self landscapeView]; [self.view addSubview:l]; [l release]; } - (UIScrollView *) landscapeView { // LANDSCAPE VIEW UIScrollView *landscapeView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 325)]; landscapeView.backgroundColor = [UIColor whiteColor]; landscapeView.delaysContentTouches = YES; NSInteger iMargin, runningY, n; iMargin = 3; runningY = iMargin; for (n = 1; n <= 38; n++) { //add day labels UIButton *templabel = [[UIButton alloc] initWithFrame:CGRectMake(iMargin,runningY,320 - ( 2 * iMargin),20)]; templabel.backgroundColor = [UIColor grayColor]; [landscapeView addSubview:templabel]; [templabel release]; runningY = runningY + 30; } landscapeView.contentSize = CGSizeMake( 320, runningY); return landscapeView; }

    Read the article

  • Can Delphi dragging be "promoted" to docking?

    - by mghie
    I have a TPageControl whose pages are all various forms that are attached using ManualDock(). The user should be able to rearrange the tabs by dragging them, which works already. It should however also be possible to undock the docked forms. For now I have the following code: procedure TMainForm.PageControlMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) and (Shift * [ssShift, ssCtrl] = []) and PageControl.DockSite then begin PageControl.BeginDrag(False, 32); end; end; If either the Shift or the Ctrl key are held down, then a docking operation will be started, otherwise the tabs can be rearranged by dragging them. Using the keys as modifiers is awkward though. Is there any way to cancel the active drag operation when the mouse cursor is outside of the tab area of the page control, and start docking the child form? This is with Delphi 2009.

    Read the article

  • jQuery's draggable grid

    - by Art
    It looks like that the 'grid' option in the constructor of Draggable is relatively bound to the original coordinates of the element being dragged - so simply put, if you have three draggable divs with their top set respectively to 100, 200, 254 pixels relative to their parent: <div class="parent-div" style="position: relative;"> <div id="div1" class="draggable" style="top: 100px; position: absolute;"></div> <div id="div2" class="draggable" style="top: 200px; position: absolute;"></div> <div id="div3" class="draggable" style="top: 254px; position: absolute;"></div> </div> Adn all of them are getting enabled for dragging with 'grid' set to [1, 100]: draggables = $('.draggable'); $.each(draggables, function(index, elem) { $(elem).draggable({ containment: $('#parent-div'), opacity: 0.7, revert: 'invalid', revertDuration: 300, grid: [1, 100], refreshPositions: true }); }); Problem here is that as soon as you drag div3, say, down, it's top is increased by 100, moving it to 354px instead of being increased by just mere 46px (254 + 46 = 300), which would get it to the next stop in the grid - 300px, if we are looking at the parent-div as a point of reference and "grid holder". I had a look at the draggable sources and it seem to be an in-built flaw - they just do all the calculations relative to the original position of the draggable element. I would like to avoid monkey-patching the code of draggable library and what I am really looking for here is the way how to make the Draggable calculate the grid positions relative to containing parent. However if monkey-patching is unavoidable, I guess I'll have to live with it. Thanks!

    Read the article

  • [Adobe Air] Can I catch a mouseUp event of an mx:Window that did not fire hte mouseDown?

    - by Irene
    Hi, In an AIR application, I have one mx:TileList with several images. What I need to do is let the user drag and drop one of the images on the desktop, giving a feeling of a desktop widget. Firstly I tried to implement this using dragStart etc, but in the end I think it is easier to handle mouseDown and mouseUp on the TileList. In general the whole setup works as desired. When a mouseDown is detected on the TileList, I create a transparent mx:Window containing the corresponding image, and call the startMove() on the Window to simulate a dragging behavior. If I release the mouse, the Window stops moving as desired. My problem is that now I want some visual feedback during dragging. It works while the Window is moving, however I can't find a way to stop it when the user releases the mouse. The mouseUp is not fired from the TileList, nor from the s:WindowedApplication. I also tried to add a listener to the Window itself, but still with no luck. Some code: private function onMouseDown(e:MouseEvent):void { trace ("down " + e.target); if (e.target is TileListItemRenderer) { // first create a dragWindow dragWindow.startGlow(); // then show some visual feedback dragWindow.moveWindow(e); // and start dragging } } private function onMouseUp(e:MouseEvent):void { trace("up " + e.target); dragWindow.stopGlow(); // <--------- Not called! } <mx:TileList id="photoTileList" mouseDown="onMouseDown(event)" mouseUp="onMouseUp(event)">

    Read the article

  • Is there a way to rotate an html table?

    - by Josh
    Is there a way to rotate an html table? So, say I had a table like this: <table id="table-1" cellspacing="0" cellpadding="2"> <tr><td>1</td></tr> <tr><td>2</td></tr> <tr><td>3</td></tr> <tr><td>4</td></tr> <tr><td>5</td></tr> <tr><td>6</td></tr> </table> and wanted to some sort of button that had javascript behind it that could rotate the table any which direction. For example, clicking the right button, results in: <table id="table-1" cellspacing="0" cellpadding="2"> <tr><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td></tr> </table> I have a drag and drop plugin that uses a table, and I am trying to do a piece that allows for a user to add to a queue (that results in the table), and then they can also rotate it around as well. Thanks.

    Read the article

  • ERROR: Failed to build gem native extension on Mavericks

    - by Kyle Decot
    I'm attempting to run bundle in my Rails project on OSX 10.9. It fails when getting to the pg gem with this error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... yes checking for libpq/libpq-fs.h... yes checking for pg_config_manual.h... yes checking for PQconnectdb() in -lpq... yes checking for PQconnectionUsedPassword()... yes checking for PQisthreadsafe()... yes checking for PQprepare()... yes checking for PQexecParams()... yes checking for PQescapeString()... yes checking for PQescapeStringConn()... yes checking for PQescapeLiteral()... yes checking for PQescapeIdentifier()... yes checking for PQgetCancel()... yes checking for lo_create()... yes checking for pg_encoding_to_char()... yes checking for pg_char_to_encoding()... yes checking for PQsetClientEncoding()... yes checking for PQlibVersion()... yes checking for PQping()... yes checking for PQsetSingleRowMode()... yes checking for rb_encdb_alias()... yes checking for rb_enc_alias()... no checking for rb_thread_call_without_gvl()... yes checking for rb_thread_call_with_gvl()... yes checking for rb_thread_fd_select()... yes checking for rb_w32_wrap_io_handle()... no checking for PGRES_COPY_BOTH in libpq-fe.h... no checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no checking for PG_DIAG_TABLE_NAME in libpq-fe.h... no checking for struct pgNotify.extra in libpq-fe.h... yes checking for unistd.h... yes checking for ruby/st.h... yes creating extconf.h creating Makefile make "DESTDIR=" compiling gvl_wrappers.c clang: warning: argument unused during compilation: '-fno-fast-math' compiling pg.c clang: warning: argument unused during compilation: '-fno-fast-math' pg.c:272:9: warning: implicit declaration of function 'PQlibVersion' is invalid in C99 [-Wimplicit-function-declaration] return INT2NUM(PQlibVersion()); ^ In file included from pg.c:48: In file included from ./pg.h:17: In file included from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby.h:33: /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:1167:21: note: instantiated from: # define INT2NUM(v) INT2FIX((int)(v)) ^ pg.c:272:9: note: instantiated from: return INT2NUM(PQlibVersion()); ^ pg.c:272:17: note: instantiated from: return INT2NUM(PQlibVersion()); ^ pg.c:375:48: error: use of undeclared identifier 'PQPING_OK' rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK)); ^ pg.c:375:56: note: instantiated from: rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK)); ^ pg.c:377:52: error: use of undeclared identifier 'PQPING_REJECT' rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT)); ^ pg.c:377:60: note: instantiated from: rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT)); ^ pg.c:379:57: error: use of undeclared identifier 'PQPING_NO_RESPONSE' rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE)); ^ pg.c:379:65: note: instantiated from: rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE)); ^ pg.c:381:56: error: use of undeclared identifier 'PQPING_NO_ATTEMPT' rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT)); ^ pg.c:381:64: note: instantiated from: rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT)); ^ 1 warning and 4 errors generated. make: *** [pg.o] Error 1 Gem files will remain installed in /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0 for inspection. Results logged to /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247@skateboxes/gems/pg-0.17.0/ext/gem_make.out An error occurred while installing pg (0.17.0), and Bundler cannot continue. Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

    Read the article

  • Selected value from drop-down list doesn't post from jquery dialog

    - by RememberME
    I have a jQuery dialog. All of the fields are posting correctly except for the drop-downs, the value is getting passed as null rather than the selected value. <div id="popupCreateCompany" title="Create a new company"> <form> <fieldset> <p> <label for="company_name">Company Name:</label> <%= Html.TextBox("company_name") %> </p> <p> <label for="company_desc">Company Description:</label> <%= Html.TextBox("company_desc") %> </p> <p> <label for="address">Address:</label> <%= Html.TextBox("address") %> </p> <p> <label for="city">City:</label> <%= Html.TextBox("city") %> </p> <p> <label for="state">State:</label> <%= Html.TextBox("state") %> </p> <p> <label for="zip">Zip:</label> <%= Html.TextBox("zip") %> </p> <p> <label for="website">Website:</label> <%= Html.TextBox("website", "http:/") %> </p> <p> <label for="sales_contact">Sales Contact:</label> <%= Html.DropDownList("sales_contact", Model.SelectSalesContacts, "** Select Sales Contact **") %> </p> <p> <label for="primary_company">Primary Company:</label> <%= Html.DropDownList("primary_company", Model.SelectPrimaryCompanies, "** Select Primary Company **") %> </p> </fieldset> </form> jQuery: $('#popupCreateCompany').dialog( { autoOpen: false, modal: true, buttons: { 'Add': function() { var dialog = $(this); var form = dialog.find('input:text'); $.post('/company/create', $(form).serialize(), function() { dialog.dialog('close'); }) }, 'Cancel': function() { $(this).dialog('close'); } } }); $("#create-company").click(function() { $('#popupCreateCompany').dialog('open'); }); My SelectList definitions: public class SubcontractFormViewModel { public subcontract Subcontract { get; private set; } public SelectList SelectPrimaryCompanies { get; set; } public MultiSelectList SelectService_Lines { get; private set; } public SelectList SelectSalesContacts { get; private set; } public SubcontractFormViewModel(subcontract subcontract) { SubcontractRepository subcontractRepository = new SubcontractRepository(); Subcontract = subcontract; SelectPrimaryCompanies = new SelectList(subcontractRepository.GetPrimaryCompanies(), "company_id", "company_name"); SelectService_Lines = new MultiSelectList(subcontractRepository.GetService_Lines(), "service_line_id", "service_line_name", subcontractRepository.GetSubcontractService_Lines(Subcontract.subcontract_id)); SelectSalesContacts = new SelectList(subcontractRepository.GetContacts(), "contact_id", "contact_name"); } }

    Read the article

  • Hibernate - strange order of native SQL parameters

    - by Xorty
    Hello, I am trying to use native MySQL's MD5 crypto func, so I defined custom insert in my mapping file. <hibernate-mapping package="tutorial"> <class name="com.xorty.mailclient.client.domain.User" table="user"> <id name="login" type="string" column="login"></id> <property name="password"> <column name="password" /> </property> <sql-insert>INSERT INTO user (login,password) VALUES ( ?, MD5(?) )</sql-insert> </class> </hibernate-mapping> Then I create User (pretty simple POJO with just 2 Strings - login and password) and try to persist it. session.beginTransaction(); // we have no such user in here yet User junitUser = (User) session.load(User.class, "junit_user"); assert (null == junitUser); // insert new user junitUser = new User(); junitUser.setLogin("junit_user"); junitUser.setPassword("junitpass"); session.save(junitUser); session.getTransaction().commit(); What actually happens? User is created, but with reversed parameters order. He has login "junitpass" and "junit_user" is MD5 encrypted and stored as password. What did I wrong? Thanks EDIT: ADDING POJO class package com.xorty.mailclient.client.domain; import java.io.Serializable; /** * POJO class representing user. * @author MisoV * @version 0.1 */ public class User implements Serializable { /** * Generated UID */ private static final long serialVersionUID = -969127095912324468L; private String login; private String password; /** * @return login */ public String getLogin() { return login; } /** * @return password */ public String getPassword() { return password; } /** * @param login the login to set */ public void setLogin(String login) { this.login = login; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @see java.lang.Object#toString() * @return login */ @Override public String toString() { return login; } /** * Creates new User. * @param login User's login. * @param password User's password. */ public User(String login, String password) { setLogin(login); setPassword(password); } /** * Default constructor */ public User() { } /** * @return hashCode * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((null == login) ? 0 : login.hashCode()); result = prime * result + ((null == password) ? 0 : password.hashCode()); return result; } /** * @param obj Compared object * @return True, if objects are same. Else false. * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof User)) { return false; } User other = (User) obj; if (login == null) { if (other.login != null) { return false; } } else if (!login.equals(other.login)) { return false; } if (password == null) { if (other.password != null) { return false; } } else if (!password.equals(other.password)) { return false; } return true; } }

    Read the article

  • how to make a div(black border,and on the google-maps) panel drop-disable,thanks

    - by zjm1126
    the black div is used to panel,so it can not be droppable. <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=0.3,maximum-scale=5.0,user-scalable=yes"> </head> <body onload="initialize()" onunload="GUnload()"> <style type="text/css"> *{ margin:0; padding:0; } .container{ padding:10px; width:50px; height:50px; border:5px solid black; } </style> <!--<div style="width:100px;height:100px;background:blue;"> </div>--> <div id="map_canvas" style="width: 500px; height: 300px;"></div> <!-- <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> --> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script> <script type="text/javascript"> var aFn; //********** function initialize() { if (GBrowserIsCompatible()) { //************ function a() { } a.prototype = new GControl(); a.prototype.initialize = function(map) { var container = document.createElement("div"); var a=''; for(i=0;i<5;i++){ a+='<div class=b style="width: 20px; height: 20px;background:red;position:absolute;"></div>' } $(container).addClass('container'); $(container).droppable( 'destroy' ).css('z-index','2700') $(map.getContainer()).append($(container).append(a)); return container; } a.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7)); } //************ var map = new GMap2(document.getElementById("map_canvas")); map.addControl(new a()); var center=new GLatLng(39.9493, 116.3975); map.setCenter(center, 13); aFn=function(x,y){ var point =new GPoint(x,y) point = map.fromContainerPixelToLatLng(point); //console.log(point.x+" "+point.y) map.addOverlay(new GMarker(point)); } $(".b").draggable({}); $("#map_canvas").droppable({ drop: function(event,ui) { //console.log(ui.offset.left+' '+ui.offset.top) aFn(ui.offset.left+10,ui.offset.top+10); ui.draggable.remove(); } }); } } //************* </script> </body> </html>

    Read the article

  • Drop down list in menu disappears before able to click

    - by user1834770
    I've had quite a search through forums looking for a solution for this, but since I don't know coding I'm not sure what applies to me and what doesn't. So, apologies if this is an often solved problem, but I'll greatly appreciate your help! After much trial and error, I've managed to get a drop down list of pages on my navigation bar; however, when I go to click on a sub-page, the entire menu disappears. I've read through other similar problems where there has been an issue with a margin that's too big, but I think my margins are set to '0'. The blog is at: http://swirlstwirlsblog.blogspot.com.au/ I haven't got content in the sub pages but there are there and linked in the html/javascript widget. I've also looked at it in Chrome, Mozilla, and Safari and it's the same issue. I'm also not sure if this is a javascript, css, or html problem, so please be kind in your responses--I'm only new! Thanks so much to anyone able to help me on this. Here's the script I used in the Widget: <ul id="jsddm"> <li><a href="http://swirlstwirlsblog.blogspot.com.au/">Home</a> <li><a href="http://swirlstwirlsblog.blogspot.com.au/search/label/sparkles">Sparkles</a> </li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/search/label/friendship">Friendship</a> </li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/search/label/humour">Humour</a> </li> <li><a href="">About</a> <ul> <li><a href="http://swirlstwirlsblog.blogspot.com.au/p/about_16.html">Us</a></li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/p/contributers.html">Contributors</a> </li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/p/advertising.html">Advertising</a> </li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/p/privacy-policies.html">Privacy</a></li> <li><a href="http://swirlstwirlsblog.blogspot.com.au/p/contact.html">Contact</a></li> </ul> </li> </li></ul> And here's the html code I put in the template: <pre>#jsddm { margin: 0; padding: 15px; z-index:1000000000; position:relative; } #jsddm li { float: left; list-style: none; font: 12px Tahoma, Arial; } #jsddm li a { display: block; white-space: nowrap; margin:1px 3px; padding: 5px 10px; border-right: 1px color: eeeeee; text-shadow: #ffffff 0 1px 0; color: #363636; font-size: 15px; font-family: crushed; text-decoration: none; vertical-align: middle; } #jsddm li a:hover { background: #C8C8C8; } #jsddm li ul { margin: 0; padding: 0; position: absolute; visibility: hidden; border-top: 1px solid white; } #jsddm li ul li { float: none; display: inline; } #jsddm li ul li a { width: auto; background: #ffffff; } #jsddm li ul li a:hover { background: #eeeeee; }</pre>

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >