visibility

Determine visibility / real z-index of html elements

孤人 提交于 2019-12-18 08:49:30
问题 Is it possible to determine if an html element is visible to the user? Example A page has an input field with a datepicker. If the user clicks on the input field, another div appears which allows the user to select the desired date. As long the datepicker is visible it hides elements which are behind it. I need a way to tell if an element is hidden or not. First Approach One way would be to check and compare the z-index values. But if they are note explicitly set, they are always auto .

Export decorator that manages __all__

北城以北 提交于 2019-12-18 06:28:04
问题 A proper Python module will list all its public symbols in a list called __all__. Managing that list can be tedious, since you'll have to list each symbol twice. Surely there are better ways, probably using decorators so one would merely annotate the exported symbols as @export . How would you write such a decorator? I'm certain there are different ways, so I'd like to see several answers with enough information that users can compare the approaches against one another. 回答1: In Is it a good

Export decorator that manages __all__

拜拜、爱过 提交于 2019-12-18 06:27:12
问题 A proper Python module will list all its public symbols in a list called __all__. Managing that list can be tedious, since you'll have to list each symbol twice. Surely there are better ways, probably using decorators so one would merely annotate the exported symbols as @export . How would you write such a decorator? I'm certain there are different ways, so I'd like to see several answers with enough information that users can compare the approaches against one another. 回答1: In Is it a good

What does a public constructor on an internal class mean [duplicate]

孤者浪人 提交于 2019-12-18 05:40:33
问题 This question already has answers here : What's the difference between a public constructor in an internal class and an internal constructor? (5 answers) Closed 6 years ago . I've seen some C# code that declares a class with an internal modifier, with a public constructor: internal class SomeClass { public SomeClass() { } } What is the point of having a public constructor, if the visibility of the entire class is internal, thus it can be seen only inside the defining assembly? Also, does this

Silverlight 4: how to switch control visibility

浪尽此生 提交于 2019-12-18 04:14:48
问题 I am using MVVM in my Silverlight app. When control visibility is need to be managed by data, I am connecting its 'Visibility' property to object's corresponding property: XAML: <TextBlock Text="Price" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> <TextBox Text="{Binding TicketPrice, Mode=TwoWay}" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> CodeBehind (C#): public string PriceVisibility { get { return PriceVisible ? "Visible" : "Collapsed"; } } But from my perspective,

Call private methods and private properties from outside a class in PHP

China☆狼群 提交于 2019-12-18 03:09:13
问题 I want to access private methods and variables from outside the classes in very rare specific cases. I've seen that this is not be possible although introspection is used. The specific case is the next one: I would like to have something like this: class Console { final public static function run() { while (TRUE != FALSE) { echo "\n> "; $command = trim(fgets(STDIN)); switch ($command) { case 'exit': case 'q': case 'quit': echo "OK+\n"; return; default: ob_start(); eval($command); $out = ob

Java Private Field Visibility

此生再无相见时 提交于 2019-12-17 22:51:39
问题 So I was making a class the other day and used Eclipse's method to create the equals method when I realized that it generated the following working code: class Test { private int privateInt; [...] public boolean equals(Object obj) { [...] Test t = (Test) obj; if ( t.privateInt == privateInt ) { [...] } } t.privateInt..???? It's suppose to be private! So I guess there is one more field visibility other than private, protected, package protected and public. So what is happening here? How is

MVVM - hiding a control when bound property is not present

半世苍凉 提交于 2019-12-17 20:04:43
问题 I was wondering if it is possible to hide a control on a view if the property to which the control is bound does not exist in the view model. For example, if I have the following: <CheckBox Content="Quote" IsChecked="{Binding Path=IsQuoted}" /> Can I detect in XAML that the IsQuoted property does not exist on the view model, and simply hide the control in that instance. I am essentially creating a wizard dialog that moves through a collection of view models, displaying the associated view for

Private method overriding and visibility

折月煮酒 提交于 2019-12-17 19:32:49
问题 I'm having a hard time trying to understand the output of the following code: class Bar { public function test() { $this->testPublic(); $this->testPrivate(); } public function testPublic() { echo "Bar::testPublic\n"; } private function testPrivate() { echo "Bar::testPrivate\n"; } } class Foo extends Bar { public function testPublic() { echo "Foo::testPublic\n"; } private function testPrivate() { echo "Foo::testPrivate\n"; } } $myFoo = new foo(); $myFoo->test(); Output: Foo::testPublic Bar:

Java swing; How to toggle panel's visibility?

大憨熊 提交于 2019-12-17 19:32:32
问题 i made this code to navigate trough panel1 and panel2 with buttons. (button1 and button2) but when i run my code the frame stays empty. Can somebody explain me what i'm doing wrong and how i can accomplish toggling between panel1 and panel2 in this way? Starting with panel1 first Code: import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JFrame; public class togglepanel { public static void main