customization

How to add support for resizing when using an undecorated JFrame?

心已入冬 提交于 2019-11-29 04:09:46
I would like to customize my titlebar, minimize-, maximize- and the close-button. So I used setUndecorated(true); on my JFrame, but I still want to be able to resize the window. What is the best way to implement that? I have a border on the RootPane, and I could use MouseListeners on the Border or the RootPane. Any recommendations? import java.awt.Color; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.border.LineBorder; public class UndecoratedFrame extends JFrame { private LineBorder border = new LineBorder

Using wordpress login functions

走远了吗. 提交于 2019-11-29 03:53:21
问题 Does anybody have any experience writing a custom Wordpress login page using the functions: wp_signon() and wp_set_auth_cookie() found on http://codex.wordpress.org/Function_Reference/ I can't seem to get them working. The code looks something like this: function login_wordpress($username, $password) { $creds = array(); $creds['user_login'] = $username; $creds['user_password'] = $password; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) { echo $user-

Customize Spring Error Message

こ雲淡風輕ζ 提交于 2019-11-29 03:52:48
I want to change the default error messages being thrown by Spring. I basically have this form. Format of the date should follow "mm/dd/yyyy" <p> <label class="label">Start Date</label> <form:input path="dteStartDate" /> <form:errors path="dteStartDate"/> </p> Everything works fine, but during binding I get this message added by the form:error tag. Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property dteStartDate; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "2010/11/19" Can I customize

How to customize Android's LockScreen?

大城市里の小女人 提交于 2019-11-29 02:24:21
I know that there is already some apps can do this, such as: WidgetLocker Lockscreen Flyscreen I want to know how to do this in my app? What classes I can use? Or what articles I should read? I don't want to change the Android's source code. And I wonder if it will be different to deal with when the screen is locked by draw pattern? Mark Allison Have a look at this answer . You need to write your own home screen app which will implement the lockscreen behaviour that you require. There is sample code for writing your own home screen app in the Android SDK. 来源: https://stackoverflow.com

Custom arrow style for matplotlib, pyplot.annotate

倾然丶 夕夏残阳落幕 提交于 2019-11-29 02:05:13
I am using matplotlib.pyplot.annotate to draw an arrow on my plot, like so: import matplotlib.pyplot as plt plt.annotate("",(x,ybottom),(x,ytop),arrowprops=dict(arrowstyle="->")) I want to use an arrow style that has a flat line at one end and an arrow at the other, so combining the styles "|-|" and "->" to make something we might call "|->", but I can't figure out how to define my own style. I thought I might try something like import matplotlib.patches as patches myarrow = patches.ArrowStyle("Fancy", head_length=0.4,head_width=0.2) (which should just be the same as "->" for now; I can tweak

Tutorial about how to write custom form fields in django?

混江龙づ霸主 提交于 2019-11-29 00:42:36
问题 Is there any good articles that explain custom form fields in django, not custom model fields? I couldn't find any through google. 回答1: Form fields are easy to customize: class UpperCaseField(forms.CharField): def clean(self, value) try: return value.upper() except: raise ValidationError basically you just create a class that inherits from the field that most resembles what you want, then rewrite the clean() method so that it returns the value you want. Here is another example: class

Customizing include-guard for Eclipse CDT

大憨熊 提交于 2019-11-28 23:23:46
I want an automatically generated include-guard by creating a new C++-class with Eclipse/CDT, but I don't find any way to change the ${include_guard_symbol} attribute. My wish is an include-guard with a namespace prefix like following: #ifndef NAMSPACE1_NAMESPACE2_HEADER_HPP But if I use #ifndef ${namespace_name}_${include_guard_symbol} for this, it will produce: namepace1::namespace2::_HEADER_HPP How can I do this? Dave E I had a dig around in the source for CDT, and found an undocumented preference setting you can use to change what is generated by ${include_guard_symbol} . There's no GUI

Cannot remove Padding from Tabs when using Custom views with Tab Layout

不想你离开。 提交于 2019-11-28 22:51:24
I have added a Relative Layout in Custom View and have added this in Tab Layout. I am using a white background for tabs and have not applied any padding in tabs custom layout. But then also I am getting padding on tabs due to which I am shown some grey background within tabs as if android is internally applying padding to tabs. I am trying to display three text views which I am able to do but one of them is truncating because of padding applied to tabs. Also I want to have consistent background color for tabs. Here is my layout code: activity_home.xml <?xml version="1.0" encoding="utf-8"?>

C# | WPF - Custom Title Bar - Drag window from top when maximized doesnt work

99封情书 提交于 2019-11-28 21:44:13
I have a custom title bar and with the window style set to none. On the click of the title bar I check to see if it is a double click (that does window maximize and restore) if it is not double clicked I do Window.DragMove . This works great for the snapping to the side and top. But when I try to drag the window when it is maximized (which would normally restore the window down), it doesn't do anything. Here is my code: static Window Window { get { return Application.Current.MainWindow; } } /// <summary> /// TitleBar_MouseDown - Drag if single-click, resize if double-click /// </summary>

How to customize UIRefreshControl with different image and position?

大兔子大兔子 提交于 2019-11-28 21:42:23
I have been looking around but couldn't find anything good about this. I would like to customize the default UIRefeshControl with different loader, etc. So far I can only change tintColor & attributedTitle properties and most code I found are just basically creating a new "pulltorefresh" effect but what I want is to just use the UIRefreshControl and customize it a bit. Is this possible? You can't add different loader without accessing private APIs, but you can add background image: UIImageView *rcImageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"refreshControl.png"]];