Create a Tab (call it MNOP) with a layout that contains textboxes that take data(numbers). - tabs

How do I create a tab in a PyQT UI that has a layout that contains the following, example.
tab name-MNOP
Layout has.
a1: textbox that can input data (numbers)
a2: textbox hat can input data
a3: textbox that can input data
a4: textbox that can input data
the data input will be stored in the db and used to create bar-graphs. right now I need to create the tab and textboxes.
right now, I am working with the following-incomplete but don't know how to proceed.
class RPBDlg(QDialog):
def __init__(self, parent=None):
super(RPBDlg, self).__init__(parent)
self.newcounter =0
grid = QGridLayout()
label = QLabel()
label.setText("<B>Plan Title:</B>")
self.titleEdit = QLineEdit()
grid.addWidget(label,0,0,1,1)
grid.addWidget(self.titleEdit,0,1,1,1)
label2 = QLabel("<B>Type of Plan</B>")
self.typeEdit = QComboBox()
self.typeEdit.addItems(["STI","LTI","STI and LTI"])
grid.addWidget(label2,1,0,1,1)
grid.addWidget(self.typeEdit,1,1,1,1)
self.bonusPool = QCheckBox("Bonus Pool")
grid.addWidget(self.bonusPool,1,4,1,1)
label3 = QLabel("<B>Sub-Type of Plan<B>")
self.subTypeEdit = QComboBox()
self.subTypeEdit.addItems(["Regular","Profit Sharing","Multiplier Based"])
grid.addWidget(label3,1,2,1,1)
grid.addWidget(self.subTypeEdit,1,3,1,1)
self.label4 = QLabel("<B>Are individual awards determined <br>through a performance formula?")
self.bonusPoolAdditional = QComboBox()
self.bonusPoolAdditional.addItems(["Yes - separate formula for individual awards","Yes - individual awards are proportional to bonus pool", "No - individual awards are discretionary","No - individual awards determined through negative discretion"])
grid.addWidget(self.label4,3,0,1,1)
grid.addWidget(self.bonusPoolAdditional,3,1,1,2)
Imports are present. This code is part of a much larger code.

If you want to use tabs in your UI you should create a QTabWidget. The basic steps for working with it are:
create a QTabWidget.
Create a QWidget with no parent for each of the pages in the tab dialog.
for them.
Insert child widgets into the page widget, using layouts to position them as normal.
Call addTab() or insertTab() to put the page widgets into the tab widget, giving each tab a suitable label with an optional keyboard shortcut.
You can find detailed information in the documentation page of the widget.

Related

Paste a value in a textbox on the second tab of a navigation form access vba

I'm quite new to VBA and I've been looking around but cannot seem to find a solution to my problem.
I have made a navigation form (frmNavigation) with 3 buttons, each referring to a different form, let's call them frm1, frm2 and frm3. In the navigationform the control buttons to switch between tabs are all named differently (btn1, btn2, btn3), but the subform that shows either frm1, frm2, or frm3 has the same name: “NavigationSubform” (this shows a different form depending on which tab is clicked on, based on the 'navagation target name' referring to frm1, frm2 and frm3).
When I want to refer to a textbox (txtBox1) on form 1 (first tab) and insert a value i can do this by:
Forms!frmNavigation!NavigationSubform.Form!txtBox1.Value = "insert awesome text"
But how would I refer to txtbox10 on the second tab (frm2)? Just using the following does not work:
Forms!frmNavigation!NavigationSubform.Form!txtBox10.Value
You then get the error 2465 (can't find the field).
I’ve been trying many different things, but can’t seem to get it right. So how do I refer to a textbox on a different tab than the first one?
Help us much appreciated!
Only one subform can be loaded at once. So you've just got to break this process into two steps.
Store the value from txtBox1 somewhere outside of the NavigationSubforms (a textbox on the parent form with visible = no, a global variable or a table works).
In frm2's On Load event, set txtbox10 to be the value you stored.
Just note, that you will need to add conditions in the On Load event if you want to avoid that textbox being set to an empty string or a wrong value if you have a setup where your filter is changing.

SSRS Report Builder 2012 - How to hide list based on field value?

I'm using Report Builder 2012 to create a report. I have inserted multiple text boxes and other controls inside a list box so that I can hide all the controls at once just by hiding the list box. I'm using a SQL Server stored procedure to fetch rows of data. I'm using below expression to hide/show the list box.
=iif(Fields!certificateType.Value = "CT", False, True)
It works fine but it only checks the first row of data. If certificateType field is "CT" in the first row of data, it shows the list box but it doesn't hide the list box back for the next row of data in which certificateType is not "CT". It seems like list box visibility only checks the first row of data and applies it for all the other rows as well. How can i check the visibility of list for all the data rows?
Okay, based on our chat I have updated this solution.
I mocked up some data that looks like this:
certificateType
---------------
AT
BT
CT
DT
ZT
I created a quick and dirty report with a list. In that, I added a rectangle with a textbox in it. I set the dataset for the list to the main dataset (DataSet1 in my case). I set the expression for the textbox to this:
=Fields!certificateType.Value
Image in design mode:
I clicked on the list, and in the Row Groups pane, I right-clicked the Details rows, and chose Group Properties. On the General section, I clicked Add to add a new group expression. Then I chose certificateType from the dropdown.
I moved to the Page Break section of the Group Properties dialog and ticked the Between each instance of a group check box. Click OK.
Now, the report will break for each instance of a certificate type that comes in the dataset. So, if you have ten different cert types in the data, you will get one page for each.
You can't see it in my image below, but there are 5 pages now.
Hope this helps!!

GWT-Can all sub widgets under TabPanel be identical?

I am creating a TabPanel with 2 sub widgets in it now. Basically the 2 sub widgets(getGrid1() and getGrid2()) are identical except some user input text validation difference when submitting.
TabPanel tabPanel = new TabPanel();
grid1 = getGrid1();
panel1 = new SimplePanel(grid1);
grid2 = getGrid2();
panel2 = new SimplePanel(grid2);
tabPanel.add(panel1, new HTML("Tab1"));
tabPanel.add(panel2, new HTML("Tab2"));
tabPanel.selectTab(0);
dialogBox.add(tabPanel);
Based on my code, those 2 tab name is visible, but there is no content in the 1st tab, the content in tab 2 is full visible. I also tried to add another sub widget which is also identical to other 2 widgets except some validation difference, only the 3rd widget content is visible.
Any idea of how to deal with it? What I want is having 3 identical widgets under TabPanel except some validation difference.
Thanks!
My guess is that getGrid1() and getGrid2() both return the same instance. Just create different instances and it should work fine.

adding hidden data to text fields in html

suppose i have a form with a table containing text boxes:
The columns are decided by user decisions earlier in the form. (the pure, unhidden form will be about 70 columns wide, usually reduced to about 5 columns)
The rows can be added and deleted by the user clicking clicking an "add_row" and a "delete_row", respectively
what i am wanting to do is be able to add hidden data to the text fields via html or Javascript so i can establish which column a certain input corresponds to in the rails controller when iterating through the table rows
Use the following script to get value of text box
var x = $("#textBox1").val();
now add a hidden data to x ie:
x = x + ":col1";
hope this helps

Want help to create a list in as3/flash

I want to create a scrollable list in flash/as3 and the important thing is.... if the user wants to move some list item up or down... he can do that by dragging the item... so when he press and hold on an item... the item will become drag-able and as the user moves it up or down the list, the other items should slide to the empty space. Its the same behavior seen in smartphones....
I'll figure out the creation, data filling, scrolling, and other mouse interaction events.... i just want help with this one behavior....of changing the order of items by dragging them. If only someone can just provide the basic algorithm or any idea how this can be achieved.. it will be enough.
​Thanks in advance
EDITS :
First of all... i apologize for not posting any details about the question... (this is my first post to this site) and hence i am adding all the research and what i have done so far.
the list is part of a big project hence i cannot share the whole code.
WHAT I HAVE ALREADY DONE :
i have created a mask, a container, a scroll bar to scroll the container, items to add into the list, methods to add items, remove items and arrange them according to the order.
hence it is a scrallable and working list.
the whole thing is in as3 and flash only.
i don't know flex and i don't want to use it either.
WHAT I WANT NEXT :
i want to change the order of these items by (mouse_down on an item -> drag it up/down -> mouse_up at the position) sequence.
If anyone wants more details i can share it.
Thanks in advance.. :)
Add a simple List component to an application
In this example, the List consists of labels that identify car models and data fields that contain prices.
Create a new Flash (ActionScript 3.0) document.
Drag a List component from the Components panel to the Stage.
In the Property inspector, do the following:
Enter the instance name aList .
Assign a value of 200 to the W (width).
Use the Text tool to create a text field below aList and give it an instance name of aTf .
Open the Actions panel, select Frame 1 in the main Timeline, and enter the following ActionScript code:
import fl.controls.List;
import flash.text.TextField;
aTf.type = TextFieldType.DYNAMIC;
aTf.border = false;
// Create these items in the Property inspector when data and label
// parameters are available.
aList.addItem({label:"1956 Chevy (Cherry Red)", data:35000});
aList.addItem({label:"1966 Mustang (Classic)", data:27000});
aList.addItem({label:"1976 Volvo (Xcllnt Cond)", data:17000});
aList.allowMultipleSelection = true;
aList.addEventListener(Event.CHANGE, showData);
function showData(event:Event) {
aTf.text = "This car is priced at: $" + event.target.selectedItem.data;
}
This code uses the addItem() method to populate aList with three items, assigning each one a label value, which appears in the list, and a data value. When you select an item in the List, the event listener calls the showData() function, which displays the data value for the selected item.
Select Control > Test Movie to compile and run this application.
source: http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7fa6.html
Finally i have got the answer from some other forum.
Here is the link to the example (behavior) that i want to add to my list :
http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/
(at the bottom 'Advanced Align Example').