Is there any way to remove 'Chart' from Actions Menu in an Interactive Grid?
So I posted a short answer that should have honestly probably been a comment with a link to https://hardlikesoftware.com/weblog/2017/01/24/how-to-hack-apex-interactive-grid-part-2/
Then I had some time and decided to try to actually execute this and got to a solution thanks to https://community.oracle.com/thread/4324589 where they also further reference https://community.oracle.com/thread/4319050
So you know where to go for more information on this topic.
As for your solution:
Go into the Attributes of the IG, Find Javascript Initialization Code under Advanced.
Then paste the following code:
function(config) {
var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();
config.toolbarData = toolbarData;
toolbarData.toolbarRemove( "chart-view" );
return config;
}
Hope this works for you, it worked for me.
EDIT:
In response to you asking how to find the name to remove.
Well thats not exactly simple. See if perhaps its mentioned in one of the posts. Otherwise you will have to search through the js file.
How I went about it is that once on the page, I opened up the console and ran $.apex.interactiveGrid.copyDefaultToolbar();
, opened up the returned array, and jumped to the definition of ToolbarRemove. This opened up InteractiveGrid.min.js so I could search there. Then I Ctrl + F there to find "chart".
What you could also do so you arent just searching blindly until you find it is that these labels need to be referenced for translation. So if you go to
http://translate-apex.com
And you find what the label is called, you can just search for that.
For the chart you could go to the translations and find the Chart item which is APEX.IG.CHART. Then in the js you find APEX.IG.CHART which only occurs once, instead of the 10 times "chart" occurs.
EDIT 2:
You asked about the Flashback dialog.
function(config) {
var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();
config.toolbarData = toolbarData;
toolbarData.toolbarRemove( "show-flashback-dialog" );
return config;
}
This works for me
Check the attributes of the interactive grid and turn off the "Define chart view"
Check this image
Related
I am trying to add a Ctrl+F accelerator to my gtkmm textview program. I already implemented the search function into an gtk Entry field, so the only thing I need is to get focus the find entry when Ctrl+F is pressed.
I googled and checked tutorials/reference of gtkmm (2.4, I'm working with that) but the only things I found were accelerators in context with menus and toolbars using UIManager, which I don't have in that .cc file I use (and I can't add them, cause its an existing program).
I tried to add an action with an AccelKey on a button or tried the function add_accelerator() but I wasn't able to use them properly (I am pretty new to gtkmm and there aren't enough samples - at least none I understand). Here some examples I tried:
_gtkActionGroup->add(
Gtk::Action::create("find", "Find", "search in file"),
Gtk::AccelKey("<control>F"),
sigc::mem_fun(this, &SrcFilesView::onGtkTxtFindAccKeyPressed));
I didn't know how to add this action to the button (in the toolbar) I created...
_gtkAccelGroup(Gtk::AccelGroup::create()) //initialized in the constructor of the class
...
_gtkBtnFind.add_accelerator("find", _gtkAccelGroup, GDK_Find,
Gdk::ModifierType::CONTROL_MASK, Gtk::ACCEL_VISIBLE);
I tried here something, but I didn't really understand neither the parameters I needed to enter here nor how this method works - ofc it didn't work...
I'd be really happy if anyone can explain me how this things work properly and sorry for my bad english. If there are any things you need just tell me please. Thanks in advance
Greetings
edit: I looked up in the gtk sources and tried to understand the parameters of add_accelerator. Now I tried this but still doesn't work...:
_gtkBtnFind.add_accelerator("clicked", _gtkAccelGroup, GDK_KEY_F /* or better GDK_KEY_f ?*/,
Gdk::ModifierType(GDK_CONTROL_MASK), Gtk::AccelFlags(GTK_ACCEL_VISIBLE));
_gtkBtnFind.signal_clicked().connect(
sigc::mem_fun(this, &SrcFilesView::onGtkTxtFindAccKeyPressed));
UPDATE:
Okay I have understood most I think now, and I know why it doesn't work. The problem is that I have to add the accel_group to the window widget, but I got only a scrolled window and boxes in my program....and now I have no clue how to continue... :)
UPDATE2:
Alright I managed to do it without accelerators by using the "on_key_press_event" handler by checking the state and keyval parameter. Hope this helps some ppl at least ^^.
bool on_key_press_event(GdkEventKey* event) { /* declaration in my constructor removed */
if(event->state == GDK_CONTROL_MASK && event->keyval == GDK_KEY_f
|| event->state == (GDK_CONTROL_MASK | GDK_LOCK_MASK)
&& event->keyval == GDK_KEY_F) {
_gtkEntFind.grab_focus();
}
return false;
}
I would be still interested in a solution with the accelerators if there is any ! Greetings
I use Coded UI in VS2012.
I would like to solve an interesting problem.
For example, there is an application which has got a window and it has got a title with dynamic content.
I would like to search this window via it's title.
The next titles are the possible cases:
"AAAAAAAA This is a window title ASDASDASD or"
"BBBBBBBB This is a window title WSDWSDWSD or not"
"CCCCCCCC This is a window title ASDASDASD or"
"........ This is a window title ASDASDASD"
I would like to search something which contains "This is a window" and "or not".
If i could use regex, i use the following expression to find this title: *This is a window*or not*.
I emphasize, that is only an example. The essential is there is a title which contains some fix strings.
I know, that a UITestControl has PropertyExpressionCollection which name is SearchProperties.
I can add to it a PropertyExpression(propertyName, propertyValue, conditionOperator) object.
The problem is: i can decide the SearchProperties with two step (formally):
WinWindow.SearchProperties.Add(WinWindow.PropertyNames.Name,"This is a window", PropertyExpressionOperator.Contains);
WinWindow.SearchProperties.Add(WinWindow.PropertyNames.Name,"or not", PropertyExpressionOperator.Contains);
How can i do it in one simple step?
Or which solution can implement this requirements?
Thanks in advance,
Peter
For reasons mentioned above it seems the best solution is to iterate thru all the windows under the desktop. Here's a snippet (for testing I'm looking for a notepad window) I'm not too proud of, but works and finishes under one second:
UITestControl result = null;
var TM = Playback.GetCoreTechnologyManager("MSAA");
var desktop = UITestControl.Desktop.GetChildren()[1].GetProperty(UITestControl.PropertyNames.UITechnologyElement) as UITechnologyElement;
var windowEnumerator = TM.GetChildren(desktop, null);
windowEnumerator.Reset();
while (windowEnumerator.MoveNext())
{
UITechnologyElement current = windowEnumerator.Current as UITechnologyElement;
if (current.Name != null &&
current.Name.Contains("Notepad") &&
current.Name.Contains("Untitled"))
{
result = UITestControlFactory.FromNativeElement(current.NativeElement, "MSAA");
break;
}
}
}
I used the MSAA technology manager because it was about seven times faster than using the UITestControls. Going down to MSAA level (IAccessible) can finish the job in about 50 milliseconds but using WinApi functions may get you the same results.
I'm sorry, I can't think of any simpler solution for this problem at the moment.
There are couple of ways to do it,
1. If you know how the Title of the page is dynamically generated,
create a static variable/class and generate the title at run time and use your code.
If you are aware of the possible Title's, create a static class and hardcode the values there.
Ive made a search function for my List Control in Report View in my MFC Dialog. It looks like this
m_List.SetItemState((m_List.FindItem(&Finde)),LVIS_SELECTED,LVIS_SELECTED );
It searches the Content that is in the Variable Finde and marks it. Now it should mark the row. But I first have to click somewhere in the program. It doesnt mark the row directly after the function gets called.
Can anyone help me?
Here is the full function
LVFINDINFO Finde;
Finde.flags = LVFI_PARTIAL|LVFI_STRING;
Finde.psz = _T("Siffert");
if ((m_List.FindItem(&Finde)) != -1)
{
m_List.SetItemState((m_List.FindItem(&Finde)),LVIS_SELECTED,LVIS_SELECTED );
//m_List.SetSelectionMark((m_List.FindItem(&Finde)));
}
else
{
MessageBox(_T("No Results"));
}
You need to use the style LVS_SHOWSELALWAYS
Otheriwse the selection is only shown when the control has the focus and is active.
EDIT: Also keep in mind that there is also a LVIS_FOCUSED style, that also forces scrolling to this item.
I have recently used a solution found in StackOverflow to remove icons on the Toolbar, however, I cannot remove one and I do not know why. I was wondering if anyone has seen and removed this extra icon successfully. The answer I used was: https://stackoverflow.com/a/15549675
This is how I used it:
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
class NavigationToolbar(NavigationToolbar):
# only display the buttons we need
toolitems = [t for t in NavigationToolbar.toolitems if
t[0] in ('Pan', 'Zoom', 'Save')]
And the extra icon looks like:
http://i.imgur.com/DQaq5Vj.png?1
Thanks!
See https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_qt4.py#L586 for where that icon is added. It is done outside of the toolitem list, hence why this method didn't work.
Adding
matplotlib.backends.backend_qt.figureoptions = None
will do what you want.
I have a problem with the FreeTextBox rich Text Editor in my ASP.NET site. The problem occurs when I access the site with firefox, and I have a freetextbox instance in a hidden div. The hidden div might also be an AJAX Tab Panel. The actual problem is that when the page loads it throws an uncaught exception (firebug shows the StoreHtml() function) and halts the postback!!
Is anywhere of the problem and a solution for it??
Thanks
I recently met a similar problem with jQuery UI tabs. What you need to do is to change the CSS for hidden tabs to something like:
.hiddentab
{
position: absolute;
left: -99999999999999;
}
This puts hidden tabs far to the left, and in absolute position mode this does not cause horizontal scroll bars to appear. When the tab is shown, simply remove the hiddentab class from the tab element.
This will work if the problem is related to Firefox' odd behavior with display: none.
I have found another solution to the problem in case anyone is looking for it. What I did was use javascript to override the OnSubmit function of the form, thus catching the exception that caused the problem and going on with the rest of the code.
However the solution is kind of "hack" since it does not cover every situation. I found the solution in the FreeTextBox forum and tried it out and it works. The only difference in my code is that I return true in the end of the override function:
function OvrdSubmit()
{
var ftbSubmit=document.forms[0].onsubmit;
if (typeof(ftbSubmit) == 'function')
{
document.forms[0].onsubmit = function()
{
try{ftbSubmit();}
catch(ex){}
}
}
// We are ok
return true;
}
Since my site is an ASP.NET site I also had to add this line in the Page_Load():
ClientScript.RegisterOnSubmitStatement(this.GetType(), String.Concat(this.ClientID, "_OnSubmit"), "javascript: return OvrdSubmit();");
Hope it helps anyone with the same problem.
Firefox has a problem with being inside anything with a style of display:none. What I did was to use a div with a zIndex that hid the div until I needed it displayed. I would start there.
Thanks for your answer, however my problem currently is that the FreeTextBox is inside an AJAX Tab Panel, therefore I would have to reconstruct the whole tab functionality in order to do so, and I do not have adequate time!
For what it's worth, I am close to a solution (I think) by setting the .ReadOnly attribute of the FTB to true and then setting it back to false on the controlo .PreRender. It works for the first time the page loads, so now I have to figure out how to implement this properly for every postback.
I will post the solution if I find it!
Thanks anyway!