MAIN_MENU MENU {
POPUP "&Manager" {
MENUITEM "New Royal Python", MENU_NEW_ROYAL_PYTHON
POPUP "&Select Python" {
}
}
}
I basically want to give the POPUP an ID so I can talk with it but it does not seem to be accepting a second parameter. Once I have done that I need to send a message to it to ask it to add a new item, what are the messages I need to send for this?
Our teacher wants us to make a timeline showing a picture from each year of our lives. I thought of a creative way of doing this in c++, make the user input the year they want to see, then make the image popup on the screen. Is this possible and how would I go about doing this? Here is the code I have so far:
#include <iostream> using namespace std; int main() { int userInput; cout << "Hello and welcome to my timeline!" << endl; cout << "Please type in what year you would like to see and press enter" << endl;
I’m working on a project that has many pop up windows. They are not organized properly and things are getting messy. I’m wondering if there are any common practice or design patterns for solving this problem.
I’d like to give some concrete examples:
1. my program connects to two different tcp ports on the same ip. cutting off any of them, the user will be notified with a MessageBox. But in case of unplugging network cable, both message box will show, which is unnecessary.
2. we provide a shortcut key to display a setting dialog. However the program can also show the same dialog when certain event happens. If the user opens the setting dialog already, those event will still trigger a second setting dialog.
3. when application settings are not correct, user will disconnect from the server and an error dialog will show up and terminate the program. But if the user knows about the situation and has opened the setting dialog to fix the issue, the error dialog will terminate his work. which is bad.
I don’t know how to deal with this window management problem in a complex software project. Of course, I can solve the issue case by case by checking if certain dialog is shown before displaying another dialog. But there are too many cases, when the code base gets big, this is not practical. There must be some generic solution I think.
I am creating a website in which a user can upload an image to a sql database. It is converted to varbinary and then read into an Image object using a http handler to convert it to an image. this all works fine. When I open an popup window I am reading data from specific rows into textboxes, thus when the user confirms any changes the rest of the data stays the same. How can I hold the Image and redisplay it when returning to the main page after closing the pop up. It currently sets the image in the database to null as the file upload object has not been given a directory location all the time. This is my attempt at reading the image from the database and then reapplying it if the file upload is empty
private void ChangeFilm(int id) { SqlConnection con = new SqlConnection(my settings go here); con.Open();
when we click on a line in text area I want to open a popup having all text from that line. I should be able to select some of its text then if I click on save button of popup then only selected text should be saved and displayed in original text area of form. I want to use this for multiple sentences of text area.
I've written a doubly linked list per my assignment instructions. I've implemented begin() and end() iterators for it, and they work with no problems when traversing the list. However, I need to sort the elements in the list. We are allowed to use the sort function defined in the <algorithm> header since we haven't yet covered sorting algorithms.
But, I'm running into a ton of problems. I figured as long as the begin() and end() iterators were defined for the list, then sort(list.begin(), list.end(), compare) would do the trick. The main errors I'm getting are:
error: no type named iterator_category error: no type named value_type error: no type named difference_type error: no type named pointer error: no type named reference
And also errors for no match of the + and - operators for the iterator class.
I understand reference, pointer, and value_type, but I have no idea about iterator_category and difference_type. Additionally, I'm a little unsure why the + and - operators need to be overloaded.
I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library.
My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file).
I have begun switching from WinForms to WPF and I'm having a hard time understanding the new concepts. In WinForms, I had a few User Controls, custom drawn using shapes (rectangles, ellipses, etc). They had some unique properties, like "Flashing" (setting this property to True and setting the "Flash Interval" property to 500 would have resulted in the control changing its background color to white and back again, every 0.5 seconds), "Beeping", etc.
I have tried to replicate these controls in WPF/XAML and so far managed to draw the shape. However, when it came to implementing a custom property that would redraw the background color of the rectangle every interval set by user in another property, i got stuck. The property is being set, but it doesn't change the background color. Alternatively, i have tried this method, with the same results (i got it to show in the "Properties" window in Visual Studio, i can set it, it is being stored in XAML, but it doesn't affect the background.
C# code behind: public struct LCARSColors { public static Brush DarkBlue = (Brush)(new BrushConverter().ConvertFrom("#FF3366CC")); public static Brush LightBlue = (Brush)(new BrushConverter().ConvertFrom("#FF99CCFF")); public static Brush Pink = (Brush)(new BrushConverter().ConvertFrom("#FFCC99CC"));
[Code] ....
If i use this line (commented in this code sample):
I've done some research and found that people use Mah metro, though I don't want to use that because I want to make a GUI that is fully mine, so I can do what ever I want to customize it to my liking.
I was going through tutorial in WPF on customs Cursor, While Running the application i am getting an exception XamlParseException was unhandled, here the code
public partial class MainWindow : Window { public MainWindow() {
I have been trying to make a custom control(list box with more features). I know how to setup custom properties, but how do I make it so that the property can be edited in a separate window ?
I think I figured out how to show the form itself, and I don't know how to make the [...] button like :
There's not much Custom Control tutorials out there, and that's really the problem here.
I am new to application coding as I previously coded Python. XAML. How to use a custom image I made as a background image in my program. I have searched everywhere but all there is about how to use the asset images.
I've been pondering which of these 2 approaches would make for the best interface for a library: Defining custom exceptions with specific names for different error scenarios but with standard behaviour, or simply using the predefined exceptions from the STL.
This is my current approach: Code: namespace rpp { class ConnectionError : public std::exception { public: ConnectionError(const std::string &p_err);
[Code] .....
This seems to make for more descriptive code but it adds no functionality and the implementations are completely identical, which seems "off" to me, somehow.
When I ran it only the calls from doers array is called 7 times normally, and donters only one time. Why is that? When I call doers from the second loop, it prints the doers functions again....and only one call to donters is made to the first static inline donter functions __dont1()...
I'm working on a code for ascertaining the minimum penalty of an assignment problem. The basic complication of my code is this: I have a vector of objects of a custom struct. The struct has a member, which is an integer. I need to keep the vector sorted according to that member, even when objects are added to or deleted from the vector. To illustrate the problem, I'll give an example.
Code:
typedef struct examplestruct{int i; char c; ...} es; int function(void) {vector<es> ObjectTable; //insert an object so that the vector remains sorted according to i insertobject( newobject, &ObjectTable); //deleting the top element of the vector deleteobject(&ObjectTable); return 0;}
I have tried to do it using bubblesort. But it's too slow. How to make a heap out of it.
The detailed premises of the problem is this: There are a number of jobs, and with each job a completion time and a cost coefficient. We are to ascertain the optimal sequence of jobs for which the penalty is minimum. Now, suppose we are given jobs A, B, C, D and E. We find out the lower bound of penalties for all the jobs.
Suppose we find B has the lowest penalty. Then we find out the lower bound of penalties for BA, BC, BD and BE. We continue this until we have the best value and a complete sequence. The way I have implemented this in a code: I have created two structs. One is Job, with the completion time and cost coefficient as members. The other is Node. Nodes have a Job Array and a Penalty as members. Now, we have a vector of Nodes which we need to keep sorted according to the penalty. We need to insert new Nodes and delete the expanded Nodes.
I have included my code. The pushInTable function inserts the new Nodes in a sorted vector. But it slows down remarkably when we give more than 20 jobs as input.
I'm trying to make a windows-focused , I will make it portable after , audio function that plays sounds according to my midi file. I know there is playsound, but it's not what I desire. I'm curious if Beep plays through the sound card or is similar to printf("a") ? I'm just looking for a low level solution.
I am currently working on a custom "Array" class for a project, and I have run into an error I don't quite understand the source of. The relevant code is as follows:
template<typename T> class Array { private: T errValCopy; public: T __errVal__; uint16 __size__; T* __ptr__; Array(const T& errorValue);
[Code] ....
When I try to run the following code:
Array<Array<int>> a(Array<int>(-1));
The error log tells me there is no appropriate default constructor available. If I understand it correctly, "default constructor" refers to the constructor which lets you just write Array<int> a; instead of Array<int> a(...);, but I can't see where in the code such a situation occurs...
I've been working on a project for a few days now, and within this project I need to have a class system that can function similarly to an if statement. The problem I'm having is I can't seem to find any good information on the order in which if statements process the information within it. I understand that if statements process whatever's in parenthesis first, but my question is that when their are several booleans of equal value, for example: "if(x == 1 && y == 2 || 3 == 4 && 4==6)", in what order does it process these true or false statements? (The actual content of the example is superfluous).
Development of a custom binary file type? So far all I know is the just the basic structures of the binary file type, I know that structures are involved but the implementation part I have run into walls.
I have made a custom class matrices class which allows me to add, multiply, subtract (etc.) matrices. I have the following method for multiplication but I get an error that says
'invalid use of 'this' outside of a non-static member function'
How can I refer to the current instance without getting this error.