is it possible to create a custom icon and display it in SAP GUI classic dynpro? I would need to display it in the toolbar of my application - if possible.
If you are asking about making your OWN icon, not using one of SAP's, then I don't think that is possible, because icons are a part of your SAPGui installation. Even if you uploaded an icon successfully (SE78 or RSTXLDMC), it would only work for you, and only work until you update or reinstall your SAPGui. Hence you wouldn't be able to create a custom icon for all users.
I think this is possible with the transaction ICON. Afterwards I think it should be possible to add it with the method add_function:
data: l_icon type string.
l_icon = icon_green_light. "<-- Icon from type-pool.
try.
lr_functions->add_function(
name = 'MYFUNCTION'
icon = l_icon
text = l_text
tooltip = l_text
position = if_salv_c_function_position=>right_of_salv_functions ).
catch cx_salv_existing cx_salv_wrong_call.
endtry.
Related
I have a form that displays file information in a TabControl, and I'd like the pages to have the file's icon in their tab. How do I get the icon associated with a file type?
I'd prefer solutions that don't involve looking things up in the registry, but if that's the only way then so be it.
CodeProject has some classes you can download.
First get the FileAssociationInfo, and from that get the ProgramAssociationInfo. The pai object can give you the icon.
FileAssociationInfo fai = new FileAssociationInfo(".bob");
ProgramAssociationInfo pai = new ProgramAssociationInfo(fai.ProgID);
ProgramIcon icon = pai.DefaultIcon;
System.Drawing.Icon.ExtractAssociatedIcon(string filePath)
is it possible to for example - write a background service, which randomly changes the windows phone theme, I mean is it possible to access the windows phone theme under settings via code? and change it?
if so can you please give me an example of the API's I can use or additional libraries I can dl
thank you
Unfortunately you can't. It is not possible to change the Windows Phone theme by code. The only one who can is the user. This is part of the Windows Phone concept.
The only thing you can do is defining themes that are used in your own apps.
Sorry for the bad news...
You are allowed to change the theme for your application. There is a Nuget package available that makes this even easier. You could accomplish changing it in a background task by setting a property that you check when the app opens.
// background agent code
// get random value
IsolatedStorageSettings.ApplicationSettings["Theme"] = randomValue; // this is just a string or something simple
IsolatedStorageSettings.ApplicationSettings.Save();
When your app opens, you would check this value
var theme = "Standard";
if(IsolatedStorageSettings.ApplicationSettings.ContainsValue("Theme"))
{
theme = IsolatedStorageSettings.ApplicationSettings["Theme"];
// Set the theme
}
You can modify the source of the Theme Manager by downloading the source from github. Here is some more info on the Theme Manager. If you would like to change values yourself, you can accomplish this by setting the resource values when the papp starts
((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = myAccentBrush;
((SolidColorBrush)Resources["PhoneBackgroundBrush"]).Color = myBackgroundBrush;
((SolidColorBrush)Resources["PhoneChromeBrush"]).Color = myChromeBrush;
((SolidColorBrush)Resources["PhoneForegroundBrush"]).Color = myForegroundBrush;
Using glade 3.8 , i created a hbox and I name the object as hboxvideo.
In my program , I add a drawing area to hbox video.
self.hboxvideo = self.builder.get_object("hboxvideo")
self.video_drawing_area=gtk.DrawingArea()
self.hboxvideo.pack_start(self.video_drawing_area,True,True,0)
self.video_drawing_area.connect("expose-event", self.area_expose_cb)
The problem is drawing area never signals "expose-event". Also these statements are called only after the main window is exposed. Any one how can I solve this issue ?
Thanks in advance,
Thothadri
I got the answer. When I imported hbox from glade and if you dynamically add widgets to it you need to show them. But if glade is not used, you just have to do window.show_all() once. In the case of glade everytime i add a dynamic widget using hbox, i need to show them.
I'm using JavaFX 2. I want my frame to open maximized but I'm not seeing a way. I searched a bit on the internet without success. For the stage I see setFullScreen() and setIconified() but I don't see anything like setMaximized().
The Java 8 implementation of the Stage class provides a maximized property, which can be set as follows:
primaryStage.setMaximized(true);
When evaluating the sourcecode of the Ensemble.jar provided with the samples of JavaFX 2.0 SDK, the currently valid way to achieve window maximizing is
Screen screen = Screen.getPrimary();
Rectangle2D bounds = screen.getVisualBounds();
primaryStage.setX(bounds.getMinX());
primaryStage.setY(bounds.getMinY());
primaryStage.setWidth(bounds.getWidth());
primaryStage.setHeight(bounds.getHeight());
(you find similar code in WindowButtons.java)
The 'maximize' button is still enabled and when clicking it, the windows will grow a bit more (Windows OS). After this the 'maximize 'button is disabled. In the provided example the standard buttons are replaced. Maybe this is still an issue.
Better use Multi-Screen compatible maximize logic:
// Get current screen of the stage
ObservableList<Screen> screens = Screen.getScreensForRectangle(new Rectangle2D(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight()));
// Change stage properties
Rectangle2D bounds = screens.get(0).getVisualBounds();
stage.setX(bounds.getMinX());
stage.setY(bounds.getMinY());
stage.setWidth(bounds.getWidth());
stage.setHeight(bounds.getHeight());
try this simpler code
primaryStage.setMaximized(true);
and it fills up the whole screen
. note that if you remove maximize/minise buttons the application will fill the whole screen as well as remove the taskbar so mnd your initStyles if you have any
Use this to remove the Minimise, Maximise Buttons :
primaryStage.initStyle(StageStyle.UTILITY);
Where primaryStage is your Stage object.
I'm having trouble in testing an RCP application with Sleak because it does not display anything, it only shows the message "WARNING: Device is not tracking resource allocation".
I've setup Sleak from this tutorial and I don't know what's wrong.
Does anyone know a solution for this? Thanks in advance.
Do you have the correct version? Can you see the sleak view in your RCP-application? If not make sure it's in your launch configuration. Also double check that you have set the
org.eclipse.ui/debug=true
org.eclipse.ui/trace/graphics=true
correct in the tracing tab. There are properties with similar names.
You can write
org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_GRAPHICS = true;
org.eclipse.ui.internal.misc.Policy.DEBUG_SWT_DEBUG = true;
before
Display display = PlatformUI.createDisplay();
This will create in Workbench.createDisplay() method
new Display with data tracking.