How to limit the number of MDI tab groups - c++

I have created a MDI application with tabbed group.
Each time I drag and drop one tab from tab bar to view, it will create a new tab group and divide view according to the number of tab groups. But I want to allow my application to create only two tab groups.
I have done my work by regrouping a new tab group with the tab group related to the drag-and-drop tab.
But this solution is not good because the view blinks for a short time.
I'm looking for a better solution. I know: drag-and-drop tab to view => create new tab group is default support by MDI Tabbed Group.
How do I check it and prevent it?

The complete job of detaching and moving the Tabs arround is done upon the message AFX_WM_ON_MOVETABCOMPLETE (registered Windows message), this message is handled by CMDIClientAreaWnd::OnMoveTabComplete.
So you can subclass your MDI client window and you can intercept the message.
Check what you want, and if you don't want to allow the drag&drop Operation just return.
If you want to allow this drag&drop just call the base implementation CMDIClientAreaWnd::OnMoveTabComplete.

Related

Create a button that will update a database table in apex

I am trying to create a button that will update a database table. I am using Oracle Application Express (APEX) 20.2. What I have done so far is create a regular button and then create a process that contains my PL SQL code that would update the table. The process is attached to the button by specifying in the "Server-side Condition" attribute to execute the process when the button is pressed. This has not work and would appreciate anyone who has any knowledge of doing this.
So all in all I am just looking to run PL SQL code that will update a table when the button is pressed.
This is the button
APEX Button
This is the process
APEX Process
The process is attached to the button
APEX Process
After pressing the button, this is what I see in Debug mode in runtime
Debug mode
After I press the button the current page stays in loading mode
Loading mode
Error I get after waiting for the loading tab to finish
Error pic
I also tried using a dynamic action instead of a process but it did not work as well. Please see image of how I set the dynamic action.
Dynamic action
I think you are overcomplicating things.
Have you tried simply making a dynamic action that is triggered when the button is pressed.
Then you can have the action run PL/SQL code to do whatever you need.
If however what you are trying to do is update a table on the screen, then what you should try is making the button just submit the page. Then make a process with the editable region being the table you are working on, do the code in there. And in case you have other submits on the page that you dont want to trigger the code, just put in a button pressed condition in the process.
The problem that was causing my button not to work was that I had a session in TOAD open and I did not commit my current query in TOAD's editor. I had to commit my changes in TOAD so that TOAD would not lock the rows that the code of the button in my APEX app was using/accessing. I also want to point out that my button worked without having to attach a process to it, instead the button needed a dynamic action attached to it as #TineO suggested.

Dynamics 365 hide New-Button in subgrid for activities

How can I hide the +NEW-Button in a subgrid of activities, when the parent records status is inactive? I tried already to hide this Button with RibbonWorkbench to see if hiding would generally work when I later implement a javascript hide-rule, but the +-Button is still visible. I tried to hide this button on the activitypointer as well as task entity but the +-Button is still visible.
Background: Customer should not be able to add new activities, when the paretn record's status is inactive.
I followed this tip How to unable create a new record button from sub grid but withou success.
Customer should not be able to add new activities, only view them
If you remove the create privilege for an entity in that user persona security role, then the Add New [+] ribbon button will be hidden automatically. That’s the right approach.

Hide a region on initial page load, show after button is clicked

I am setting up a report on a page with multiple checkbox page items and start and end date page items. The user clicks a 'Run Report' button to generate a report region below on the page.
The default selections for the checkbox items are all items selected, and the Start and End Date items have default options based SQL queries.
I want to the report region to hide on the initial page load, and then show once the user clicks 'Run Report'. I tried the following solutions:
Set region condition to 'Never' and then use a dynamic action to show the region once the button is clicked. However, I think the 'Never' condition trumps the dynamic action.
Create two dynamic actions, one on page load to hide the region and on clicking the button to show the region. However, the show DA is always overwritten once the page loads again because of the first hide dynamic action, so the region never displays.
Has anyone else run into this problem? Any solutions? Thank you!
You may like to consider the 'lazy loading' described on Maxime's blog.
https://askmax.blog/2018/05/18/lazy-loading-report/
Like you said, a server side condition will trump and DAs that are showing/hiding on the browser, as the region would never render.
If you want to hide something on entry, you can do something similar to what you described, but I'm not quite sure what you've done.
on load dynamic action to hide region (or add
style="display:none;" to custom attributes of region.)
on click of your button, show the region (do not run on initialisation), and
refresh the region.

What navigation short-cuts exist in aws UI console for power users?

I've seen a couple of ways to navigate.
How many different ways exist for power users in 2019 ?
I create my own browser shortcut in Chrome's "Manage Search Engines", set to:
https://console.aws.amazon.com/%s/home?region=ap-southeast-2
The %s in the middle can be entered in the browser address bar, so I can instantly jump to any service by typing the search keyword and the service name, eg con s3 or con sqs.
There are a lot of ways!
1. Services Dropdown
First of all there is the menu system you get from clicking services
It lists most of the services for you to click on one.
Below you can see several of the Compute Menu Items - EC2, Lightsail, etc.
2. Input Search Field
Next you can type the service you are looking for in the text box, e.g.
3. Recent History
Next you can use the recent history of functions that shows on the left for recently used functions
4. Bookmarks
Finally (and my favorite) you can 'pin' commonly used areas to the top bar, similar to a browser bookmark bar. You can have icons, text or both, for example I have just Icons to squeeze more in. Click the thumbtack icon to change which ones you have:
Of course you can also have your classic browser bookmarks for the various areas too and you may prefer all your bookmarks in one place. Or are ok with them being in two places as well.

Can I attach an event handler to a barchart bar in Superset?

Is is possible to attach event handler to a bar in a barchart?
I have a barchart that displays average income (each bar represents a province)...
What I need is: when I click a bar that represents "Illinois" for example, my dashboard will be update with data pertaining only to "Illinois".
That's something that Microsoft Power BI can do. Wondering if that's possible in Superset.
It is definitely not supported for now. Unfortunately you can not customize any behaviour on bar events except checkboxes in controls area. But if you are familiar with javascript you can customize this behaviour in js scripts /superset/assets/visualizations/ after cloning repo and installation from source code.