How do I customize a ckeditor 4.2 builtin plugin like links?

You got to observe dialogDefinition event to do this: CKEDITOR.on( ‘dialogDefinition’, function( evt ) { var dialog = evt.data; if ( dialog.name == ‘link’ ) { // Get dialog definition. var def = evt.data.definition; // Add some stuff to definition. def.addContents( { id: ‘custom’, label: ‘My custom tab’, elements: [ { id: ‘myField1’, type: ‘text’, … Read more

WPF: How to customize SelectionBoxItem in ComboBox

I would do it like this: <Window.Resources> <DataTemplate x:Key=”NormalItemTemplate” …> … </DataTemplate> <DataTemplate x:Key=”SelectionBoxTemplate” …> … </DataTemplate> <DataTemplate x:Key=”CombinedTemplate”> <ContentPresenter x:Name=”Presenter” Content=”{Binding}” ContentTemplate=”{StaticResource NormalItemTemplate}” /> <DataTemplate.Triggers> <DataTrigger Binding=”{Binding RelativeSource={RelativeSource FindAncestor,ComboBoxItem,1}}” Value=”{x:Null}”> <Setter TargetName=”Presenter” Property=”ContentTemplate” Value=”{StaticResource SelectionBoxTemplate}” /> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> </Window.Resources> … <ComboBox ItemTemplate=”{StaticResource CombinedTemplate}” ItemsSource=”…” … /> The reason this works is that CombinedTemplate … Read more

Is this possible to customize printf?

Sorry, but some answers are incorrect on Linux with Glibc On Linux with a GNU Glibc, you can customize printf: you would call register_printf_function to e.g. define the meaning of %Y in your printf format strings. However, this behavior is Glibc specific, and might even become obsolete… I’m not sure I would recommend this approach! … Read more

How to customize UISwitch button in iphone?

You can not modify UISwitch control unless and until you write your own control, But best way so far, you can used UISegmentControl and handle event on it to switch the on.png and off.png images. UISegmentedControl* switchView=[[UISegmentedControl alloc] initWithItems:[[[NSMutableArray alloc] initWithObjects:@”On”,@”Off”,nil] autorelease]]; [switchView setFrame:CGRectMake(20,365,140,28)]; switchView.selectedSegmentIndex=0; switchView.segmentedControlStyle=UISegmentedControlStyleBar; [switchView setImage:[UIImage imageNamed:@”onSelected.png”] forSegmentAtIndex:0]; [switchView setImage:[UIImage imageNamed:@”off.png”] forSegmentAtIndex:1]; [switchView … Read more

How to customize list preference radio button

Styling the ListPreference from XML is not directly possible. The problem is that ListPreference (through DialogPreference) calls AlertDialog.Builder(Context) to build its Dialog, rather than AlertDialog.Builder(Context context, int themeResourceId). While the latter allows for providing a theme, the former does not, causing it to fall back to a default Android theme. For a project, I needed … Read more

How to customize / style a UIPopoverController

This is possible starting in iOS 5.0 by subclassing the abstract class UIPopoverBackgroundView and assigning your subclass to the popoverBackgroundViewClass property on your UIPopoverController instance. Unfortunately there is no tintColor property as the popover needs to use images for it’s arrow and border in order to achieve smooth animations during dynamic resizing. You can learn … Read more