I want to create a XML file in csharp like the below format pls help me with the code
<MasterEntries>
<fruit>Apple</fruit>
<animal>Fox</animal>
<color>Violet</color>
</MasterEntries>
Hi all,
I have a header file with all the enums listed (#ifndef #define #endif construct has been used to avoid multiple inclusion of the file) that I use in multiple cpp files in my application.One of the enums in the files is
enum StatusSubsystem {ENABLED,INCORRECT_FRAME,INVALID_DATA,DISABLED};
There are functions in the application delcared as
ShowStatus(const StatusSubsystem&);
Earlier in the application when I made calls to the above function like
ShowStatus(INCORRECT_FRAME);
my application used to compile perfectly. But after some code was added The compilation halts giving the following error:
File.cpp:71: error: invalid conversion from `int' to `StatusSubsystem'
File.cpp:71: error: initializing argument 1 of `void Class::ShowStatus(const StatusSubsystem&)
I checked the code for any conflicting enums in the new code and it looked fine.
My Question is what is wrong with the function call that compiler shows as erroneous?
For your reference the function definition is:
void Class::ShowStatus(const StatusSubsystem& eStatus)
{
QPalette palette;
mStatus=eStatus;//store current Communication status of system
if(eStatus==DISABLED)
{
//select red color for label, if it is to be shown disabled
palette.setColor(QPalette::Window,QColor(Qt::red));
mLabel->setText("SYSTEM");
}
else if(eStatus==ENABLED)
{
//select green color for label,if it is to be shown enabled
palette.setColor(QPalette::Window,QColor(Qt::green));
mLabel->setText("SYSTEM");
}
else if(eStatus==INCORRECT_FRAME)
{
//select yellow color for label,to show that it is sending incorrect frames
palette.setColor(QPalette::Window,QColor(Qt::yellow));
mLabel->setText("SYSTEM(I)");
}
//Set the color on the Label
mLabel->setPalette(palette);
}
A strange side effect of this situation is it compiles when I cast all the calls to ShowStatus() as
ShowStatus((StatusSubsystem)INCORRECT_FRAME);
Though this removes any compilation error, but a strange thing happens. Though I make call to INCORRECT_FRAME above but in function definition it matches with ENABLED. How on earth is that possible? Its like while passing INCORRECT_FRAME by reference, it magically converts to ENABLED, which should be impossible. This is driving me nuts.
Can you find any flaw in what I am doing? or is it something else?
The application is made using C++,Qt-4.2.1 on RHEL4.
Thanks.
/* Style 1 */
.myclass {
background:#ff0;
border:1px solid #ff0
}
#myid {
width:80px;
height:80px;
}
/* Style 2 */
.myclass { background:#ff0; border:1px solid #ff0 }
#myid { width:80px; height:80px; }
I'm sure there must be more styles for writing CSS, I'd like to know what are they. Is there an article already written that lists all styles.
Thanks
Is there an efficient way to take and image and be able to replace a given color with another given color using .NET Compact Framework?
For example, to replace white with black or vice versa?
Hi, I have a web browser in my access form. I am embedding a gif file on it. but how ever i re size it there is a white border coming in the top and left side. The adjustments take place only at the bottom and right side. So when i embed a gif file with black background i end up getting a white background on the top and left sides, how do i make this go.
thanks
tksy
I cannot make the image a background image to a div and round the div's corners because the image is resized, and as far as I know, you cannot resize a background image.
What are my options, if any? Open to all suggestions including wrapper divs and corner images.
Also, if it cannot be done in IE but there's a solution for Firefox, that's just fine with me.
Hi
I have created two different grid background and radio button style in my
App.xaml.
User can select any style to change the look of the page i.e: Changing the background and style of the radiobutton.
Now When I click on the raduio button the application navigates to another page and the style disappears.
Is there a way to Set the style in application level or I need to store the styleVar as Global Var and check on the second page load and then apply the styles as per the styleVar.
Hi,
I created one blackberry application which will play a video on a button click.This is my code,
invocation=new Invocation("file:///SDCard/Blackberry/videos/PlayingVideo/funny.mp4");
registry=Registry.getRegistry("net.rim.device.api.content.BlackBerryContentHandler");
try
{
registry.invoke(invocation);
}
catch(Exception e)
{
}
Now i can play the Video file.After clicking the Back button the native player is going to the background.It always running in the background.But i want to close that player.I have no idea about how to do it.Anybody knows please help me.
One of my ListView's needs to be created in code. When I specify a ListView in xml, I can set a dividerHeight and assign a color to the divider.
But apparently, in code a color is not acceptable nor is pointing to a resource id. Only a Drawable is acceptable - and I haven't gotten to that chapter yet.
Can someone point me to an example of setting a ListView divider in code?
Hey everybody, this is not really a question, I have just written an article on Code Project on how to create rich interactive backgrounds for Silverlight applications. This background reacts to a users mouse movements and causes a fluid animation of the background elements.
hi my problem is how to create footer image in this video screen while playing....
how to create this format. now i am give my description:
• 1) Header image, a stretched background image. The location of this external image comes
from the application xml;
• 2) Footer image, a stretched background image. The location of this external image comes
from the application xml;
2.a) the copyright, disclaimer and buy block, this block contains links to popup
windows that contain a copyright and or disclaimer. And an option to buy the
application for the advertisement less version. The content of this block is fed
trough the application XML feed. The color of the text is fed by the application
xml plus the popup links and texts itself;
• 3) Carousel image, a stretched background image. The location of this external image
comes from the application xml;
3.a) the carousel contains objects that can flow from right to left, possibly trough a
animation (a soft break of the slide). The first object is centered in the middle
of the carousel. This is the first element in the video feed. All the subsequent
video object are added to the right of the centered object;
4) Total Video object, this object links to window two with the corresponding video of
this object.
This object is visually build out of the following sub parts:o
4.a) Thumb object (possible playing video thumb);
4.b) Reflection of the Thumb;
4.c) Textual Explanation of Thumb.
1) Video stream, this is the video stream coming from a external server streamed to the
television (maybe up scaled) as 720p stream;
2) Advertisement, the type of advertisement shown overlaid on the video is based on
previous settings in the video feed. This could mean that Admob, Adsense or a third
party image plus URL could be shown. When the advertisement is selected trough
navigation (it will highlight in a different color as a border around the
advertisement. The color an thickness can be managed trough the application xml),
when clicked a browser will open with the associated site (the application will be
pushed to the background process, when the user is finished it will return to
the app);
3) A back button, an image and navigational element. The location of the image comes from
the application xml. The button is only shown when a cursor is moved (a button is
pressed on the remote) it will highlight when selected and when pressed will forward
the screen to the main window. When the main window is opened the video will be
removed from cache and memory and cannot be start from the point it was exited.
please give me your idea....
I have a dense set of points in the plane. I want them colored so that points that are close to each other have the same color, and a different color if they're far away. For simplicity assume that there are, say, 5 different colors to choose from. Turns out I've not the slightest idea how to do that ..
I'm using Tkinter with Python, by the way
Hi,
I have a customized navigation bar with a image background. I do want to show the title on the background but I need its text for the back button in the next view.
How can I do it please?
Thank you
ps: self.title=@"" will not put (naturally) in the back button the previous title.
Hello,
Could you please explain me, how do templating engines in JavaScript work? Thank you.
JSON
{ "color" : "red"}
Template
<strong><%=color%></strong>
Result
<strong>Red</strong>
Is their any way to add background image in VIM.
like, I don't know is is possible or not. If you know any way to do this tell me.
:set background=dark
Thanks.....
If I define the up and over states of a button like this:
.button {color:red;}
.button:hover {color:blue;}
How can I get all the hover state styles for an element using JQuery?
Something like $(".button:hover").styles...
I'm able to draw a circle on a transparent background, but it's pixelated around the edges.
I can also get an anti-aliased circle on a non-transparent background with http://mierendo.com/software/antialiased_arcs/.
So, how do I get both?
sifr3 text doesn't load many time first time on FF 3.5? I haven't checked on other browser.
If i reload page again then it loads properly.
this is my code
sIFR.replace(futura, {
selector: '#Homepage h1', ratios: [6, 1.24, 9, 1.13, 10, 1.15, 16, 1.09, 21, 1.06, 22, 1.07, 25, 1.04, 26, 1.06, 29, 1.03, 30, 1.05, 31, 1.03, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01],
wmode: 'transparent',
css: '.sIFR-root { background-color: none; color: #ffffff; }'
});
I'm curious if anyone still creates icons other than RGB/A (or 32-bit with alpha-channel) for your Windows apps?
PS. I know that suggested model is to create 256-color versions of icons, but I always struggle with those. If I automatically convert them in an icon editor they totally decimate the look of my original icons with jagged edges and circa-Windows95 look. So if those are still required, does anyone know the stats on how many people are still using color settings other then 32-bit TrueColor?
I have a lightbox-style div with scrolling content that I am trying to restrict to a reasonable size within the viewport. I also want this div to be horizontally centered. This is all easy in Fx/Chrome/IE9.
My problem is that IE8 ignores the absolute positioning which I use to size the content, and the rule margin: 0 auto which I use to horizontally center the lightbox.
1) Why? 2) What are my options for workarounds?
EDIT: The centering issue is fixed by setting text-align:center on the parent element, but I have no idea why that works since the element I want to center is not inline. Still stuck on the absolute positioning stuff.
HTML:
<div class="bg">
<div class="a">
<div class="aa">titlebar</div>
<div class="b">
<!-- many lines of content here -->
</div>
</div>
</div>
CSS:
body { overflow: hidden; height: 100%; margin: 0; padding: 0; }
/* IE8 needs ruleset above */
.bg {
background: #333;
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
height: 100%; /* needed in IE8 or the bg will only be as tall as the lightbox */
}
.a {
background: #eee; border: 3px solid #000;
height: 80%; max-height: 800px; min-height: 200px;
margin: 0 auto;
position: relative;
width: 80%; min-width: 200px; max-width: 800px;
}
.aa {
background: lightblue;
height: 28px; line-height: 28px;
text-align: center;
}
.b {
background: coral;
overflow: auto;
padding: 20px;
position: absolute;
top: 30px; right: 0; bottom: 0; left: 0;
}
Here's a demo of the problem: http://jsbin.com/urikoj/1/edit
I wanted to align a newsticker about 300px above it's current position , but I am unable to do so. Please help.
The page is uploaded for viewing at http://cerebration.0fees.net/test/bottom.html
scroll down the page to find the newsticker.
The css file contains the css code for the newsticker and the newsticker is of white color(color mentioned for identification).
The html page code is at : http://pastebin.com/dP8dSEDS
and the css code is as at : http://pastebin.com/46YvqwT7
Thanks in advance.
Hi all i have a background worker thread and some unmanaged code dlls , In progress changed event of background worker . I will get the data from my database in a datatable and make this table as my DataSource. But when i use the scrollbards od DataGridView my application crashes.when I try to debug the application it gives "Unhandled exception in TestExe.exe : 0xC0000096: Privileged Instruction.
I am using the Microsoft Chart Controls for .NET 3.5 (C#) and have a chart in a winform.
My hope is to allow the user to change the color palette based on their preference.
How do I iterate through the color properties of the ChartColorPalette and add them to a combobox list?
I know it should be something like:
for each(something in ChartColorPalette)
{
combobox.items.add(something.ToString);
}
I am developing an iPad application where i want to reduce the textsize in a segment in a UISegmentController.Please help. I also want to change the selected segment color. currently the default color we get when a segment is selected is blue. I want to change it to red. Please help me if anyone is aware of these solutions. I am trying to use a Xib file to make the segments.