Search Results

Search found 17342 results on 694 pages for 'custom draw'.

Page 135/694 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • Custom size app screen on iPad

    - by mosdev
    I am trying to create a mid-size screen for my app on iPad. In didFinishLaunchingWithOptions(), I do this: CGRect winRect = CGRectMake(100,100,500,500); navController.view.frame = winRect; the screen comes up fine and I can click around and do stuff until the orientation changes. It takes the screen to original full size - how can I make it stick to my winRect frame? I tried setting the parentViewController.view.frame/view.frame to winRect in willRotateToInterfaceOrientation() but no good. Any ideas? Thanks.

    Read the article

  • Custom date time picker for Windows Forms that is locked to GMT time

    - by m3ntat
    Using Visual Studio 2008, c#, .net 2.0. I have a Windows Forms client application that contains a scheduling UI section, currently this is housed only in the London office with the standard datetime picker control, the selected time is saved in a UK database (GMT) and a London based server aapplication processes the schedules. There is a requirement to roll the client out to various global locations, Hong Kong, New York etc and allow them to setup schedules that run according to GMT time on the London server. I'll have a label on screen saying "note schedules are GMT" what I need is a good way to present a datetime picker that always shows and is in sync with the database server's GMT time regardless of where the client app is running globally. Suggestions on how to acheive this? thanks.

    Read the article

  • jQuery validation plugin , add custom method

    - by Eatdoku
    Hi, I am trying to add a method that validate a field to see if it contains a number value. so this is what i did, however it is not doing the check for me. anyone has any idea? thanks $(document).ready(function() { $.validator.addMethod('positiveNumber', function(value) { return Number(value) > 0; }, 'Enter a positive number.'); }); and jQuery('form').validate(); jQuery('.validateFieldToCheck').rules('add', { positiveNumber:, messages: { required: 'Field must contain a number.' } });

    Read the article

  • using the data-custom="" to bind to events

    - by Dean Peterson
    I'm pretty sure I'm gonna get slammed on this. I love using the data-whatever attribute to bind events to. It feels very clean to me and helps reserve my class attribute for just styling. I know this selector is among the slowest, so I don't use it when there are a lot of elements. Would love to hear compelling arguments against this. $("body").delegate("[data-action]", "click", function(){ var action = $(this).attr("data-action"); //route action to appropriate function });

    Read the article

  • Can't get custom error rendering to work in symfony 1.4

    - by hongkildong
    I'm tring to customize error rendering in my form according to this example. Here is my code: if ($this['message']->hasError()) { $error_msg = '<ul>'; foreach ($this['message']->getError() as $error) $error_msg .= "<li>$error</li>"; $error_msg .= '</ul>'; } return $error_msg; but when $this['message'] has error this code returns '<ul></ul>' so it seems foreach ($this['message']->getError() as $error) causes no iterations $this['message']->getError() returns sfValidatorError object - maybe something changed in symfony 1.4 and it isn't iterable anymore... At first I thought that all magic in that example happened because of object being placed in $error by iteration implements __toString() but it seems no iterations happens at all...

    Read the article

  • Problems using an id from a model inside a custom sql query in Rails

    - by Thiago
    Hi there, I want to do a model class which associates to itself on Rails. Basically, a user has friends, which are also users. I typed the following inside a User model class: has_many :friends, :class_name => "User", :foreign_key => :user_id, :finder_sql => %{SELECT users.* FROM users INNER JOIN friends ON (users.id = friends.user_id OR users.id = friends.friend_id) WHERE users.id <> #{id}} But the funny fact is that it seems that this finder_sql is called twice whenever I type User.first.friends on irb. Why?

    Read the article

  • Extend TTPhotoViewController with custom TTPhotoView

    - by ggould75
    I have successfully integrated the three20 framework in my project, and I have extended the TTPhotoViewController to add some further functionality. Now I need to add some subviews to the TTPhotoView loaded by the TTPhotoViewController. In particular I would like to add that subviews after every TTPhotoView as been loaded. These subviews represents sensible area over the image so they should scale proportionally with the image. The user can tap a subview to get extra info about the image. I don't know how to implement this behavior. Should I extend the TTPhotoView and make sure that the TTPhotoViewController use this extended version instead of its TTPhotoView? Could someone point me to the right direction? Thank you

    Read the article

  • QGrid display default "loading" message when updating a table / on custom update

    - by JVXR
    I have a case where I need to update a jqgrid based on some search criteria which the user selects. I can get the data to update , but I would want the loading message to show while the new data is being fetched. Can someone please let me know how to get that working ? Current code follows var ob_gridContents = $.ajax( { url : '/DisplayObAnalysisResults.action?getCustomAnalysisResults', data : "portfolioCategory="+ $('#portfolioCategory').val() +"&subPortfolioCategory="+ $('#subPortfolioCategory').val() + "&subportfolio=" + $('#subportfolio').val(), async : false }).responseText; var ob_Grid = jQuery('#OBGrid')[0]; var ob_GridJsonContents = eval('(' + ob_gridContents + ')'); $('#ob_Grid').trigger("reloadGrid"); ob_Grid.addJSONData(ob_GridJsonContents); ob_Grid = null; ob_GridJsonContents = null; }

    Read the article

  • ASP.NET custom server control: nested items

    - by Dylan Lin
    Hi, In the aspx code view, we can code like this: <asp:ListBox runat="server"> <asp:ListItem Text="Item1" /> <asp:ListItem Text="Item2" /> </asp:ListBox> However, the ListItem class is not a server control. How could we do that? Is there some attributes being consumed by the visual studio? Thanks:)

    Read the article

  • How to display custom processing message in JQuery datatables

    - by Sukhi
    i am using datatables api to display data in my asp.net4.0 application; datatables I have one column [ Delete ] to delete the row data.when i click on this link i send a jquery ajax request to delete the row from database. I want to display a message such as [ Deleting record... ] to the end user until data deleted by server side processing. I put a div on my page and write a message [ Deleting record... ] in a div when i click on delete link i display that message but when delete operation complete it also display a message [ Processing... ](which is inbuilt message of datatables) which looks like odd as two message are displaying. What can i do better to display message to the end user. JSCode $('#tblVideoList .delete').live('click', function (e) { e.preventDefault(); var oTable = $('#tblVideoList').dataTable(); var aPos = oTable.fnGetPosition(this.parentNode); var aData = oTable.fnGetData(aPos[0]); if (confirm('Are you sure want to delete the record.')) { $("#divDelete").show(); var today = new Date(); $.ajax({ type: "GET", cache: false, url: "samplepage.aspx", success: function (msg) { $("#divDelete").hide(); oTable.fnDraw(); } }); } return false; }); Thanks

    Read the article

  • custom string format 0,0 with slash or back slash

    - by Mamad R
    i have a WPF TextBox that user can type number in that . now i am searching for a string format that can separate TextBox number each 3 point (like 0,0) but i want separate text with Slash or Back Slash or another character. and we do not know how much point our number has. i am searching for string format not Linq solution or etc . i read Microsoft help but cant find any way . sample = 123456789 == 123/456/789 (good) --- 123,456,789 (bad)

    Read the article

  • XmlSerialize a custom collection with an Attribute

    - by roomaroo
    I've got a simple class that inherits from Collection and adds a couple of properties. I need to serialize this class to XML, but the XMLSerializer ignores my additional properties. I assume this is because of the special treatment that XMLSerializer gives ICollection and IEnumerable objects. What's the best way around this? Here's some sample code: using System.Collections.ObjectModel; using System.IO; using System.Xml.Serialization; namespace SerialiseCollection { class Program { static void Main(string[] args) { var c = new MyCollection(); c.Add("Hello"); c.Add("Goodbye"); var serializer = new XmlSerializer(typeof(MyCollection)); using (var writer = new StreamWriter("test.xml")) serializer.Serialize(writer, c); } } [XmlRoot("MyCollection")] public class MyCollection : Collection<string> { [XmlAttribute()] public string MyAttribute { get; set; } public MyCollection() { this.MyAttribute = "SerializeThis"; } } } This outputs the following XML (note MyAttribute is missing in the MyCollection element): <?xml version="1.0" encoding="utf-8"?> <MyCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>Hello</string> <string>Goodbye</string> </MyCollection> What I want is <MyCollection MyAttribute="SerializeThis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>Hello</string> <string>Goodbye</string> </MyCollection> Any ideas? The simpler the better. Thanks.

    Read the article

  • Implementing Drag and Drop using MouseListener for custom Components

    - by Chris Lieb
    I am working on a school assignment that requires me to be able to pick up a tile, drag it to a location, then drop it there. I was able to get this working using TransferHandler and a bunch of stuff from the dnd package, but this is not an acceptable way to perform this action for this assignment according to the professor. So, I am trying to achieve the same effect using the MouseListener interface. The basic setup is this: I have a JPanel-derived class called LocationView that contains JLabel-dervived instances of TileView. I need to get events that give me the LocationView that has the mouse pressed on and the LocationView that has the mouse released on. I am proxying mouse events through the TileView to its containing LocationView so that I can properly handle the mousePressed event. I added System.out.println()'s to the mouse listeners for mousePressed and mouseReleased to both LocationView and TileView so that I could observe the events that were being generated. To my surprise, pressing the mouse on Tile A in Location A, then dragging to Location B and releasing would generate a mouse released event for both Tile A and Location A, but not for Location B. I need the mouse released event triggered for only Location B. To try to work around this, I tried implementing a glass pane based off of the FinalGlassPane found at http://weblogs.java.net/blog/2006/09/20/well-behaved-glasspane. After adding the glass pane and adding an event listener for it, I can see that the mouse events are indeed filtering through the glass pane, but the mouse released event is still only being called on the item the mouse was clicked on. Is there a way to have mousePressed and mouseReleased events associated with the same drag action be called on separate components?

    Read the article

  • Add custom param to odata url

    - by Toad
    I want to add some authentication to my odata service. The authorization token i want to include in the url as param so that the url can be used in excel How would one be able to receive and parse any addition param supplied in the url before the odata service does it's thing? (i'm using entitie framework and wcf dataservices)

    Read the article

  • Custom rowsetClass does not return values

    - by Wesley
    Hi, I'm quite new to Zend and the database classes from it. I'm having problems mapping a Zend_Db_Table_Row_Abstract to my rows. The problem is that whenever I try to map it to a class (Job) that extends the Zend_Db_Table_Row_Abstract class, the database data is not receivable anymore. I'm not getting any errors, trying to get data simply returns null. Here is my code so far: Jobs: class Jobs extends Zend_Db_Table_Abstract { protected $_name = 'jobs'; protected $_rowsetClass = "Job"; public function getActiveJobs() { $select = $this->select()->where('jobs.jobDateOpen < UNIX_TIMESTAMP()')->limit(15,0); $rows = $this->fetchAll($select); return $rows; } } Job: class Job extends Zend_Db_Table_Row_Abstract { public function getCompanyName() { //Gets the companyName } } Controller: $oJobs = new Jobs(); $aActiveJobs = $oJobs->getActiveJobs(); foreach ($aActiveJobs as $value) { var_dump($value->jobTitle); } When I remove the "protected $_rowsetClass = "Job";" line, so that the table row is not mapped to my own class, I get all the jobTitles perfectly. What am I doing wrong here? Thanks in advance, Wesley

    Read the article

  • linq selecting into custom object

    - by user276640
    what is wrong with such code public List<SearchItem> Search(string find) { return (from i in _dataContext.News where i.Text.Contains(find) select new SearchItem { ControllerAction = "test", id = i.Id.ToString(), LinkText = "test" }).ToList(); } public struct SearchItem { public string ControllerAction; public string LinkText; public string id; }

    Read the article

  • playing video in custom size screen - view in iphone

    - by sagar
    OK. Some New Query Here. Suppose user taps on a button & video begins to play. Now when video plays, it always in full screen mode. But what do i need is explained below. Video should be played in a portrait mode. (but normally video is played in landscape mode ). How? Thanks in advance for sharing your knowledge with SO...

    Read the article

  • Help with 2-part question on ASP.NET MVC and Custom Security Design

    - by JustAProgrammer
    I'm using ASP.NET MVC and I am trying to separate a lot of my logic. Eventually, this application will be pretty big. It's basically a SaaS app that I need to allow for different kinds of clients to access. I have a two part question; the first deals with my general design and the second deals with how to utilize in ASP.NET MVC Primarily, there will initially be an ASP.NET MVC "client" front-end and there will be a set of web-services for third parties to interact with (perhaps mobile, etc). I realize I could have the ASP.NET MVC app interact just through the Web Service but I think that is unnecessary overhead. So, I am creating an API that will essentially be a DLL that the Web App and the Web Services will utilize. The API consists of the main set of business logic and Data Transfer Objects, etc. (So, this includes methods like CreateCustomer, EditProduct, etc for example) Also, my permissions requirements are a little complicated. I can't really use a straight Roles system as I need to have some fine-grained permissions (but all permissions are positive rights). So, I don't think I can really use the ASP.NET Roles/Membership system or if I can it seems like I'd be doing more work than rolling my own. I've used Membership before and for this one I think I'd rather roll my own. Both the Web App and Web Services will need to keep security as a concern. So, my design is kind of like this: Each method in the API will need to verify the security of the caller In the Web App, each "page" ("action" in MVC speak) will also check the user's permissions (So, don't present the user with the "Add Customer" button if the user does not have that right but also whenever the API receives AddCustomer(), check the security too) I think the Web Service really needs the checking in the DLL because it may not always be used in some kind of pre-authenticated context (like using Session/Cookies in a Web App); also having the security checks in the API means I don't really HAVE TO check it in other places if I'm on a mobile (say iPhone) and don't want to do all kinds of checking on the client However, in the Web App I think there will be some duplication of work since the Web App checks the user's security before presenting the user with options, which is ok, but I was thinking of a way to avoid this duplication by allowing the Web App to tell the API not check the security; while the Web Service would always want security to be verified Is this a good method? If not, what's better? If so, what's a good way of implementing this. I was thinking of doing this: In the API, I would have two functions for each action: // Here, "Credential" objects are just something I made up public void AddCustomer(string customerName, Credential credential , bool checkSecurity) { if(checkSecurity) { if(Has_Rights_To_Add_Customer(credential)) // made up for clarity { AddCustomer(customerName); } else // throw an exception or somehow present an error } else AddCustomer(customerName); } public void AddCustomer(string customerName) { // actual logic to add the customer into the DB or whatever // Would it be good for this method to verify that the caller is the Web App // through some method? } So, is this a good design or should I do something differently? My next question is that clearly it doesn't seem like I can really use [Authorize ...] for determining if a user has the permissions to do something. In fact, one action might depend on a variety of permissions and the View might hide or show certain options depending on the permission. What's the best way to do this? Should I have some kind of PermissionSet object that the user carries around throughout the Web App in Session or whatever and the MVC Action method would check if that user can use that Action and then the View will have some ViewData or whatever where it checks the various permissions to do Hide/Show?

    Read the article

  • Custom theme and sherlockActionBar

    - by Atomico
    I am doing a personal theme to use holo widget in 2.3 android. I did this: <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="AppThemes" parent="@style/Theme.Sherlock"> <item name="android:editTextStyle">@style/EditTextAppTheme</item> <item name="android:checkboxStyle">@style/CheckBoxAppTheme</item> <item name="android:radioButtonStyle">@style/RadioButtonAppTheme</item> <item name="android:buttonStyle">@style/ButtonAppTheme</item> <item name="android:imageButtonStyle">@style/ImageButtonAppTheme</item> <item name="android:spinnerStyle">@style/SpinnerAppTheme</item> <item name="android:dropDownSpinnerStyle">@style/SpinnerAppTheme.DropDown</item> <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItemAppTheme</item> </style> </resources> the problem is that widgets don't take the correct style but take the default style. I tried to force assign the @style/EditTextAppTheme at an edittext and it worked.. so the problem is that the theme don't apply. any idea? update: the theme apply and work good..the solo problem is some edittext inside a dialog that show with the standard theme

    Read the article

  • Adding a custom control to a page, then adding multiple custom children into that one, null user con

    - by Rickjaah
    Hello all, While nerding my way through the day again. I came across a problem concerning adding children to an already add child control. I can add the controls, but when trying to use the controls in the added control, they all return null. This is the method: protected override CreateChildControls(EventArgs e) { UserControl uControl = LoadControl("~/controls/TwoColumn.ascx"); PlaceHolder holder = uControl.Controls.FindControl(phrContentMiddle) as PlaceHolder; holder.Controls.Add(LoadControl("~/controls/ImageShowControl"); } When i try to call any type of button/UserControl inside the ImageShowControl.... All return null. Is this something in the Page LifeCycle? If so, what is the way to go to realize this?

    Read the article

  • Custom spring interceptor

    - by Hari
    Hi, I want to convert some of our internal API into a spring bean spring interceptor that we can use in other projects. This API needs some instantiation and other logic which I want to encapsulate in this bean so that we can just put the bean into our app context with necessary propoerties alone, and this will then apply the logic. I remember having read an article on this somewhere in the past - but cant find it now. Any pointers to something similar will be helpful EDIT: Sorry, I meant a spring interceptor, not a bean - my bad - please see my edit. I want to apply this interceptor to another bean dealing in XML messages.

    Read the article

  • XSLT inserting once off custom text

    - by BeraCim
    Hi all: The folloiwng is a pre-existing xml file. I was wondering how can I insert a element before the first element using xslt? <XmlFile> <!-- insert another <tag> element here --> <tag> <innerTag> </innerTag> </tag> <tag> <innerTag> </innerTag> </tag> <tag> <innerTag> </innerTag> </tag> </XmlFile> I was thinking of using a for-each loop and test the position = 0, but upon the first occurence of the for-each its already too late. This is a once-off text so I can't combine it with other xslt templates that are already inside the xsl file. Thanks.

    Read the article

  • How do I assign custom classes to YUI3 plugin/widget objects

    - by Akshar Prabhu Desai
    Consider the following code. var overlay = new Y.Overlay({ id:'tooltip-tag', bodyContent:"Loading.....", xy:[e.target.getX(),e.target.getY()+30] }); The overlay gets the id as given in attributes. But what if I want to add a class ? IS there something like: var overlay = new Y.Overlay({ **class:'tooltip-tag'**, bodyContent:"Loading.....", xy:[e.target.getX(),e.target.getY()+30] });

    Read the article

  • Custom Alignment and Backgrounds Through Greasemonkey

    - by Jivec
    I'm trying to implement something in greasemonkey and it is giving me a fair bit of trouble as I can't get it to work. I frequently use Wolfram Alpha (http://wolframalpha.com) for a lot of things. They have recently updated the home page with a new style. There are settings that you can edit on this page (http://www.wolframalpha.com/homesettings.html) As you would expect when you clear cookies you loose these settings. What I would like to do is have a greasemonky script that sets the background to what ever I like (which will stay also regardless of the state of your cookies). It would also be cool if this background was displayed the whole way through Wolfram Alpha (ie when you make queries too eg. http://www.wolframalpha.com/input/?i=stack+overflow ) The other thing I'm trying to implement but I'm struggling is to force the results pages to be left aligned so that the browser window can be smaller. If anyone could help me with this it would be appreciated, I have tried to do it my self but I'm unsure how to get it to work.

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >