Child panel in parent panel- strange top value
Hi!
I want to write application where I have menu with buttons. Depending on the button pressed the buttons should hide and another design bring on front.
I don't have any ideas except make that on different panels. I made one parent panel, and a few child panels. When I click button the panel with buttons hides and I'm displaing another panel with width and height equal to parent panel. I can't understand why I have to always have value equal to 30 in top property of child panel. Left property is set o zero and it's displaing OK. When I set 0 to top property the child panel is partially hidden in parent window.
Why the top property have to be always set to 30 to display exactly panel in panel? I tried to switch on and off titlebar, but it seems taht is no problem. Anyone can explain me that behaviour? Maybe any other ideas to make that kind of application? I don't want to use tabs.
I'm attaching some pictures so that there's no confusion over what I'm talking about. I'm using the userint/panels.cws, but I modified childPanel1 to be the exact height of the parent panel as you can see in this picture taken from the UI Editor:
If I don't programmatically set the top of the panel and auto-center vertically is not set to true, then I get this when the panel is loaded. You can see that the panel is being cut off because it loads inside the parent panel using the top value set in the UIEditor.
If I set the child panel to auto-center vertically it looks like this. You can see that the child panel's title bar is partially obscured due to the auto-centering, and the splitter at the bottom of the child panel is not visible.
If I then programmatically set the top and left to (0,0) I get this. The frame of the child panel (including the title bar) is hidden, but you can see that everything on the panel is visible:
If I programmatically set the top to 30 it looks like this. The title bar is visible but you can see that the control at the bottom of the panel is now no longer visible:
I'm assuming that you're seeing the behavior in the 4th screen shot when you set the top to 0 and something similar to the 5th screen shot when you set the child panel top to 30. I'm guessing that due to the font being used on your machine, the thickness of the child panel title bar is actually 30 so it doesn't stand out quite as much as mine.
When setting the position of a panel inside another panel, the frame (which includes the titlebar) is ignored, so that (0,0) cooresponds to the very first pixel that is actually visible in the panel. I'm guessing that what you want to do is either:
A) Disable the titlebar in the child panel and set the frame thickness to 0, or
B) If you need the titlebar of the child panel to visible, change the height of the of the child panel to be = (height of parent panel - 30).
Kevin B.
National Instruments
Similar Messages
-
How send menu shortcut keystroke from child to parent panel
Hello,
I have simple question:
Parent (main) panel has a menubar and menuitems (menu_callbacks), with some shortcut keys (like <F5>, <Ctrl>+<R> etc).
The task is propagate the keystroke from the child panel to the parent panel when the parent panel is INACTIVE.
I try to make solution via EVENT_KEYSTROKE and CallPanelCallback(), but this solution doesn't work correctly ...
Any hits will be appreciated!
GeorgeHi, Roberto,
you are right, the example of course works correctly.
I'm such a fool, - because I thought of the child panels in "user", not the programmatic concept.
Explanation: the "child" panels are programmed as "top-level panel", I use
panel = DuplicatePanel (0, gui_dpl_pPoll, title, VAL_KEEP_SAME_POSITION, VAL_KEEP_SAME_POSITION);
because I want to let the child panel 'float' over whole display ().
When I change
panel = DuplicatePanel (main_pMain, gui_dpl_pPoll, title, ...
the keystroke is propagated correctly .... But the child panel is (of course) cropped to parent panel boundary.
So I rephrase the question - how to send menu shortcut keystroke (not processed) from one (top-level) panel to another panel?
George -
Child panel -how to put him at specific place in Parent panel
Hello I created program with main panel which other panels as tabs.
I need to put child panel on on of the tab panels .
How can i do that and obtain view of the child panel only
on the right panel?
I'm attach a picture to describe.
Thank you for your comments
Meir
Solved!
Go to Solution.
Attachments:
panels.JPG 122 KBHi Meir,
it seems to me that you are missinig a very basic concept about the tab control: each tab actually IS a child panel! That is, all the controls you have on your test panel can be simply loaded on the tab page you want, leaving other pages unchanged.
You may be missing the scroll bar on the right, which effectively is not present on tab controls, but as far as I can see your interface could be reduced to a single table control put on a tab page with appropriate row and colunm headers.
In any case, if you don't want to heavily modify your existing code you can use InsertPanelAsTabPage () command to add a panel you have previously loaded to the tab control: in this case an existing scroll bar is maintained. Keep in mind that this instruction actually make a copy of the original panel, so you will need to retrieve the correct tab page handle to address control on the added page. The original panel can be discarded immediately after adding it to the tab control.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Control tooltip on parent panel
In the enclosed picture there is a parent panel and a child panel.
I have added tooltip to row of picture buttens. The tooltips are displayed for those buttons that is to the
left of the child panel. It seems as the child panel is above the tooltip.
Anything I can do rather then resize one of the panels
Regards Per
Attachments:
Untitled.png 40 KBI'm not sure I completely understand the premise of the question. While it's true that the position of the tooltips cannot be controlled, I'm having a hard time understanding how the tooltips could be overlapped by something else, given that they are floating windows, as Wolfgang pointed out.
I considered the possibility that you meant "overlapped by another child panel" or "overlapped by another too-level panel". If the tooltip was going to be covered by a child panel, it should definitely display above that panel:
(In these screenshots, "Text Message" is the control with the tooltip).
If you meant a top-level panel, then this is a bit trickier to reproduce, since in order for the tooltip to trigger, the panel that holds the control with the tooltip must be the active panel. Therefore, the only way that another top-level panel could overlap that region would be if the other panel was floating. In that case, you have two floating windows. But when I tested it, the tooltip was still on top (I guess because it was created last):
So, I'm not sure how you were able to cover up a tooltip. Could you maybe post a screenshot, so that I can understand it better?
Thanks,
Luis -
Problem in Passing the value from child window to Parent window.
Hi Frenz,
I have a requirement like this. i have to pass a value from child window to parent window to one test field. That text field is not a normal text field.
It was created like the following as SQL query.
select
''LNo,
apex_item.text(25,'',0,15,
'style="width:100px;" onblur="javascript:showUpsell(this.value);" onkeypress="javascript:validateKeyPress(event,this.value,this.id);" onkeyup="javascript:this.value=this.value.toUpperCase();" id="P37_ITEMNO"') ItemNo
Now i want to pass a value to the Item no from child window.
i wrote the java script like this,
opener.document.forms[0].f25.value="100";
It was not working..Any suggestions for that..
Thanks in advanceDear Baaju,
How do you redirect your control from Child to Parent window.
If you use a button to do this, then you can set this value in the branching of page.
Rana -
Can i use a jlabel on a panel then place gifs, on top of that jlabel?
im doing a project that requires a 10x10 board and found a picture that is exactly the size i need 400x400, can i place the background (gif file) on a jlabel then place it on my boardPanel, then on top of that place images on the board accordingly? or is there more useful and better way? or do i have to use Mediatracker for both the background image and the placing of pieces. any suggestions or tutorials on this, its my first time making a board and making the pieces movable on the it.
thanks in advance!have to use Mediatracker for both the background image and the placing of piecesMediaTracker has nothing to do with the placing of images. It is only used to read the image file. Actually I believe the newest recommendation is to use the ImageIO class to read image files.
Heres one way to use an image as a background that might work for you since it appears that your background image will be the same size as your game board.
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
public class LabelPanel extends JFrame
public LabelPanel()
JLabel label = new JLabel( new ImageIcon("????.jpg") );
label.setLayout( new GridLayout(4,4) );
getContentPane().add(label);
for (int i = 0; i < 16; i++)
JPanel panel = new JPanel();
panel.setOpaque( false );
panel.setBorder( new LineBorder(Color.RED) );
label.add( panel );
public static void main(String[] args)
LabelPanel frame = new LabelPanel();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setLocationRelativeTo( null );
frame.setVisible(true);
}For other ideas you can search the forum using "background image" as keywords if I remember correctly. -
Center a panel in another panel
Good day:
I am trying to center align (horizontal & vertical centering) a panel in another panel.
How would I go about doing this?
I have tried a few different layout managers, but they have not produced the results I am looking for.
The parent panel is fixed sized, but the child panel is dynamic.
Please help!!Thank you for your post, I greatly appreciate it. However, I tried both of those methods, and my child JPanel is always being placed in the upper left corner of the parent JPanel.
Here is some code showing my initialization of the JPanel, and the adding of the child JPanel:
Creating the parent JPanel:
imagePreview = new JPanel();
imagePreview.setBackground(Color.white);
imagePreview.setBorder(new LineBorder(Color.black,1,true));
getContentPane().add(imagePreview);Adding the child JPanel
void displayThumbnail()
wallpaperChanger.imagePreview.removeAll();
wallpaperChanger.imagePreview.add(new viewer(THUMB_LOCATION));
wallpaperChanger.imagePreview.repaint();
}If it helps, the viewer class:
class viewer extends JPanel
private Image image;
public viewer(String fileName)
Toolkit toolkit = Toolkit.getDefaultToolkit();
image = toolkit.createImage(fileName);
MediaTracker mediaTracker = new MediaTracker(this);
mediaTracker.addImage(image, 0);
try
mediaTracker.waitForID(0);
catch (InterruptedException ie)
System.err.println(ie);
setSize(image.getWidth(null), image.getHeight(null));
//show();
public void paint(Graphics graphics)
graphics.drawImage(image, 0, 0, null);
} -
How to pass a data from child window to parent window
Hi,
I have a jsp page with two hidden fields and a button, On clicking the button a popup will come out. There are two combobox in the popup and a search button. After putting a value in the comboboxes,if I click the search button, I need the datas of the combobox to pass to the parent's hidden fields then I need to do a data base search with that values of hidden fields and display the result in the parent page.
I could I solve this problem, Please help, Its urgent.
Thanks and Regards
Rajib SharmaI think that you can use the JavaScipt as follow to pass a data from child window to parent window
<HEAD>
<script>
function passData(){
opener.form1.test1.value=form2.test2.value; //pass the value of test2 to the parent's test1
window.close();
</script>
</HEAD>
<BODY>
<form name=form2>
<input name=test2 type=text>
<input type=button onclick="passData()" value=CLOSE>
</form>
</BODY> -
Moving child node's parent in JTree
hi guys.
What i have is a Jtree dynamically generated, im trying to re-arrange the nodes inside.
each nodes and their parents have their own values and been built with DefaultMutableTreeNode.
So im thinking, to do so i first need to analyse which child node i want to move, then remove it from its current parent, then set the new parent to this node.
I been thinking of using the values and compare them to do the parent-node matching, however, i have been looking at the APIs without luck, for methods to possible retrieve the values of the childs/parents.
Or perhaps there is a simpler way,
Does anybody have a clue where i could find some answers to this problem?
Cheers, Eric.aiwick wrote:
hi guys.
What i have is a Jtree dynamically generated, im trying to re-arrange the nodes inside.
each nodes and their parents have their own values and been built with DefaultMutableTreeNode.
So im thinking, to do so i first need to analyse which child node i want to move, then remove it from its current parent, then set the new parent to this node.
I been thinking of using the values and compare them to do the parent-node matching, however, i have been looking at the APIs without luck, for methods to possible retrieve the values of the childs/parents.
Or perhaps there is a simpler way,
Does anybody have a clue where i could find some answers to this problem?
Cheers, Eric.Not sure what the problem is exactly. DefaultMutableTreeNode has methods for retrieving it's parent and child nodes: which is all you need to move nodes in your tree. -
Check a checkbox in a jtable in a panel from another panel
I have a panel-> Panel A
where I have some conditions and on that condition I want to check a checkbox in a jtable in another panel ->PanelB
So Panel B has a jtable with one column as checkbox,I want to check/uncheck this checkbox based on some conditions in some other panel A
I have no idea how to do this.Please help.
Thanks885522 wrote:
How will the change be reflected dynamically if the value changes in some other panel.By code that you write. If you want component X to change based on some changes to component Y, then first you set up a listener which will notify you when changes to component Y take place. In that listener you put code which makes the appropriate changes to component X, based on what happened to component Y. -
Auto creation of child requests when parent request has more than one group
Hi,
I have created a request dataset which has a child form for AD Group. While raising a request, if I add more than one group, how to process the approval flow. Because I will be having different different approvers for different different groups. Is there any way to create child requests automatically when we submit a request with more than one group? I am using OIM 11.1.1.5.0.
I know in OIM 11g, whenever user raises request for more than one beneficiary/target-resource then OIM breaks that request into Child Requests. But this is not happening when I add more than one group in the same resource. Do I need to write my own code for DataValidator to split parent request into child requests upon validating child form? If so, is it going to impact the existing feature which is creating child request when parent has more than one user/resource.
Please let me know.No not possible OOTB in current version. Check {thread:id=2318652} for more information.
-Bikash -
How to access objects in the Child Form from Parent form.
I have a requirement in which I have to first open a Child Form from a Parent Form. Then I want to access objects in the Child Form from Parent form. For example, I want to insert a record into a block present in Child Form by executing statements from a trigger present in Parent Form.
I cannot use object groups since I cannot write code into Child Form to first create object groups into Child Form.
I have tried to achieved it using the following (working of my testcase) :
1) Created two new Forms TESTFORM1.fmb (parent) and TESTFORM2.fmb (child).
2) Created a block named BLK1 manually in TESTFORM1.
3) Created two items in BLK1:
1.PJC1 which is a text item.
2.OPEN which is a push button.
4) Created a new block using data block wizard for a table EMPLOYEE_S1. Created items corresponding to all columns present in EMPLOYEE_S1 table.
5) In WHEN-NEW-FORM-INSTANCE trigger of TESTFORM1 set the first navigation block to BLK1. In BLK1 first navigable item is PJC1.
6) In WHEN-NEW-ITEM-INSTANCE of PJC1, code has been written to automatically execute the WHEN-BUTTON-PRESSED trigger for the "Open" button.
7) In WHEN-BUTTON-PRESSED trigger of OPEN item, TESTFORM2 is opened using the following statement :
open_form(‘TESTFORM2',no_activate,no_session,SHARE_LIBRARY_DATA);
Since its NO_ACTIVATE, the code flows without giving handle to TESTFORM2.
8) After invoking OPEN_FORM, a GO_FORM(‘TESTFORM2’) is now called to set the focus to TESTFORM2
PROBLEM AT HAND
===============
After Step 8, I notice that it passes the focus to TESTFORM2, and statements after go_form (in Parent Form trigger) doesnot executes.
I need go_form with no_activate, similar to open_form.
Edited by: harishgupt on Oct 12, 2008 11:32 PMisn't it easier to find a solution without a second form? If you have a second window, then you can navigate and code whatever you want.
If you must use a second form, then you can handle this with WHEN-WINDOW-ACTIVATED and meta-data, which you have to store in global variables... ( I can give you hints if the one-form-solution is no option for you ) -
Fastest way to create child class from parent?
As the subject states, what do you folks find is fastest when creating child classes directly from the parent? (esp. when the parent is in a lvlib) I thought I'd post up and ask because the fastest way I've found to get working takes a few steps.
Any suggestions ae appreciatized!
-patThanks for the quick response Ben!
Yea, I apologize, in your response I realize my OP was more than vague haha (it hapens when you get used to your own way of doing things I guess huh)- I'm trying to create a child from a parent so that it has all of the methods that the parent has.
In order to do so I currently have to open and close LV a few times during my current process so that vi's in memory dont get mixed up- Currently I save a copy of the parent class in a sub dir of where it is saved, close out of LV, open the new 'copy of parent.lvclass', save as>>rename 'child class.lvclass', close LV, and open up the project to 'add file', then right click>>properties>>inheritance.
Is this the only way to do this?
Thanks again!
-pat
p.s. I'm tempted to steal your cell phone sig, hope you dont mind haha good stuff! -
Child .swf controlling parent timeline
Hello Captivate Heroes,
I've searched around, and can't seem to find any solid info on an issue my team is having. I'm a bit of a noob when it comes to Javascript, so I apologize if this question is too basic for this forum.
Is it possible for an embedded .swf (created in Captivate) to control the main timeline in a parent .swf? Consider the example below:
1) This window is an embedded .swf (another captivate file, which I’ll refer to as the “child”) that has an interactive walkthrough. It loads and begins playing immediately. I want users to complete this module and all interactions in it before continuing to the next slide in the “parent” file. Essentially, I want either the child or the parent timeline to play, but never both at the same time.
2) This is our normal continue button, and I don’t want it appearing until 1 has been completed.
My solution was to add a javascript call on the first slide of the child file that tells the parent file to pause its timeline (something like _root.rdcmdPause=1;). Then, do the opposite on the last child slide ( _root.rdcmdResume=1;). In this way, the parent slide would essentially pause on its first frame (which doesn’t have an active continue button) while the child animation continues to play. However, this isn’t working. It’s been a really long time since I’ve scripted, so I’m very rusty. Is that the proper way to manipulate parent variables in a child file? Do you have any other ideas on how to accomplish this task?
I have a backup solution -- providing a "password" at the end of the child animation, which users can use to unlock the continue button. I'd rather use a more graceful solution
Thank you in advance,
JamieHi Jamie,
I don't think JavaScript is going to help you here. You need to be doing this in ActionScript 3.
For the non-scripting part, you can control the Captivate movie using system variables. To pause the main slide, you could assign rdcmdPause=1 on the Slide Entry action. You may want to adjust the slide transition to none so that it won't look faded out when it pauses the movie. You can also show/hide items on the slide using the timeline, but it sounds like you won't really know when the Learner will be done with the interactive child .swf.
From what you described, it sounds like the Child .swf (#1) needs to communicate with other objects on the slide... mainly the continue button (#2). In order to do that you'll most likely need to make the child .swf #1 into a widget so that it can communicate with the main movie and other objects on the slide. I would suggest 3 possibilities:
1. Learn to use a widget framework such as Widget Factory or CpGears to make this possible
2. Take a look at the Infosemantics Event Handler Widget. Not sure if it will meet all your needs, but it's worth a look.
3. Hire a Captivate Widget Developer to make this possible... and yes I am a Widget Developer (shameless plug )
Hope that helps,
Jim Leichliter -
How To Display attributes of Child Node and Parent Node in same view
Suppose I have two view Carview and CarDetail View...IN Component context I have Parent Node Called Cars and It have its attribute as Price,Warranty,Year and also One Child Node Called as Brand Name Whose attribute are PrimaryBrand and SecondaryBrand..Now If I do Mapping of My First View i.e CarView with Child node of BrandName..and then I Have To Show Whole Detail of Car in CarDetailView.......How Can I Achieve it..
Hi Vinay,
You can map the child node and even the paren tnode to the same view if u want to display in the same window..
If not if ur requirment is to dispaly in the sme view but should not map the child and parent to the Same view then you can take another new view.. and insert 2 view containers and then add the Child view and parent view in that view containers and then Diaplay the newly created view.
Regards,
Raju Bonagiri
Maybe you are looking for
-
How to display the "display values" in READ Only mode for a SHUTTLE
Hi, I have a form item of type *'Shuttle'* and using the following LOV. select DEPTNAME d, DEPTNO r from DEPTIn normal mode..it displays the department name and internally store the Deptno.. Now I converted this item to Read Only mode using R
-
Terminated with error: REP-1924: Cannot locate the font file 'Arialbd.ttf'
hi all i am using Application server 10g R2 while running report i am getting the following error Terminated with error: REP-1924: Cannot locate the font file 'Arialbd.ttf' i configured the Reports_Path with C:\windows\fonts if anyone faced the same
-
Hello please I want the solution I have in my iTunes I own $ 112 and you purchase from the game of war gold price of gold and 99.99 discount iTunes money did not come in the gold game of war and that I am two days ago, I did not find the solution ple
-
Transfer of Org Unit from one loc to another Loc
Hi ALL, I have issue regarding transfer of organizational unit from one loc to another loc is it possible to shift total org unit from one loc to another loc. what r all prerequisties required for changing. With Best, Shaik
-
Wierd flickering with latest chromium
I've been having some wierd flickering with the latest chromium. I get black portions of the screen (including outside the chromium window). I ocasionally get a black i3-statusbar when scrolling with chromium, and the I see a lot of wierd artifacts o