C++ :: How To Manage Popup Windows
Mar 24, 2014
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.
View 4 Replies
ADVERTISEMENT
Aug 3, 2014
I create new dialog window. I add container Fixes and change Fixed properties : - AutoSize, +Expand, +Fill to enable other widgets. I add Text View, Textview is inside GtkScrolledWindow which has property X and Y but not Height and Width. If GtkScrolledWindow has scrollbars, its size is fixed, if not - size depends on the content Textview and grows when I type text. I want not to grow control if I type Text but want my own size. It is possible?
View 7 Replies
View Related
Nov 19, 2013
I wrote a class to manage pointers better (because I am making a large program and don't want to call a constructor on somthing that was already deleted... etc...), but I am getting some compiler errors. I'm not sure what to do.
here is the class prototype:
template<typename type>
class pointer_class{
public:
pointer_class() : dat(NULL), del(false) {}
explicit pointer_class(const pointer_class<type>& d) : dat(NULL),
[Code].....
View 19 Replies
View Related
Jan 17, 2013
I wrote a class pedal that allows to search for the serial port on which the pedal is connected. Therefore I send a request to the pedal and set up a timer event of 20 ms. If no reply, I search for the next serial port.
When found I send configuration to the pedal and set another timer event of 200 ms that requests for pedal state. It runs fine.
Now if the pedal is disconnected then connected again I would like it to run again.
Therefore I set another timer event every 2s that launches all what I described above.
The trouble comes because the 20 ms timer event doesn't run and I do not understand why.
View 3 Replies
View Related
Jul 13, 2014
I have a POPUP
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?
View 8 Replies
View Related
Mar 31, 2014
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;
[Code] ....
View 11 Replies
View Related
Jul 30, 2014
recently I developed a class header only in C++ to deal with byte arrays. Since I developed programs in other languages that had some libraries to dial with byte arrays, I developed one that the syntax is very similar to other languages.
Since I'm not very familiar with memory management, I was concerned about somethings I've read about (ex: memory fragmentation).
Here is a very simple example of my practice:
class ByteArray {
public:
ByteArray(size_t size) {
buffer = (int8_t*)malloc(size);
}
[Code].....
The class is intended to be used as part of comunication protocol in a webserver, byte arrays are created and destroyed a lot. Should I use pools? Is there a better practice? Am I doing everything wrong (laugh)?
For those who wants to see the entire class: [URL]
View 9 Replies
View Related
Jun 23, 2014
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();
[Code].....
View 5 Replies
View Related
Apr 17, 2014
I want to select text entered in a popup and save it. I have a form that contains a text area and a button
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="103px" Width="262px"></asp:TextBox>
<br />
<br />
<asp:button runat="server" text="Add" onclick="Unnamed1_Click" />
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.
Add button will add new line.
View 8 Replies
View Related
Jun 4, 2013
I was reading a c++ code written in embarcadero ide to add vertical colour text in popup menu.
While reading the code, I had seen following instructions.
private:
Code:
void __fastcall ExpandMenuItemWidth(TObject *Sender, TCanvas *ACanvas,int &Width, int &Height);
Code:
void __fastcall DrawNewItem(TObject *Sender, TCanvas *ACanvas, const TRect &ARect, bool Selected);
The above two methods used in the code like below:
Code:
PopupMenu1->Items->Items[i]->OnMeasureItem = ExpandMenuItemWidth;
PopupMenu1->Items->Items[i]->OnDrawItem = DrawNewItem;
What is happening when we are using member function without parameters like above?
I found above code at: [URL] ....
View 2 Replies
View Related
Oct 12, 2012
I'd like to compile following code:
Code:
sigfillset( &sa.sa_mask );
sa.sa_handler = &CDevice::PipeHandler;
sa.sa_flags = 0;
sigaction( SIGPIPE, &sa, NULL );
sa.sa_handler = &CDevice::TerminatorHandler;
sigaction( SIGQUIT, &sa, NULL );
sigaction( SIGINT, &sa, NULL );
Using MSVC 2010 to run on Windows 7. Is it possible?
View 1 Replies
View Related
Jul 2, 2012
Here are the libraries included:
#include <iostream>
#include <cmath>
#include <cstdlib>
#include "stat.h"
And heres the line being flagged:
d=ttl*drand48()-fit[0]; //intialize to reigon for first entry
The error I receive is one discussed on a number of different forums:
C:Documents and SettingssarabrownDesktopSarahScheduling Codestat.cpp|181|error: `drand48' undeclared (first use this function)|
C:Documents and SettingssarabrownDesktopSarahScheduling Codestat.cpp|181|error: (Each undeclared identifier is reported only once for each function it appears in.)|
||=== Build finished: 2 errors, 1 warnings ===|
It just seems to me theres a lot of conflicting information about if this is even possible to do on Windows and when I do try work around functions or calling double drand(void) I get a ton of errors. I'm hesitant to try rand() or something less precise. I was hoping maybe someone would be able to maybe suggest a compiler which will run this or a different library, right now I'm using Code Blocks IDE.
View 1 Replies
View Related
Nov 14, 2013
I am wondering how can I read a website from a given url in windows ?
View 3 Replies
View Related
Apr 2, 2013
i am just making some new programmings and testing it. But every time after compile and run The dos window is closing and again I have to compile And run command so i want The dos windows should prompt me for next input rather than closing.
View 2 Replies
View Related
Jan 6, 2015
how can i minimize all open windows using c++ program? I want to call the minimize function at some places in my program... so write how the function structure can be made and how do i call it?
View 2 Replies
View Related
Mar 7, 2013
I have download the SOIL library [URL] for loading textures in OpenGL, however it doesn't come with a SOIL.lib file but a file called libSOIL.a and it says I need to compile it myself.
View 11 Replies
View Related
Apr 21, 2014
I have my dialog set upand I am trying to view a slider controls value. This is not to do with .NET framework it is the old controls.
View 1 Replies
View Related
Jan 17, 2013
I want to know how mutex is working in process synchronization. Where these mutexes are stored in memory how another process know about this mutex?
If two different mutexes are having same name what will happen?
View 6 Replies
View Related
Jan 7, 2015
How to make a keypad in my windows form? Need to finish my project at school...ATM machine app..
It is just the keypad part. Do i put 10 buttons and add a textbox...
View 2 Replies
View Related
Feb 9, 2015
Basically I want to embed the QGIS canvas widget into a custom application. In order to do that, I need to build QGIS from it's source in order to obtain the devel *.lib, *.dll, *.h, etc. files required. To that result, I am trying to build either version 2.6.* or the current nightly build ~2.7 - 2.8 64 bit version. There is very little documentation on the x64 builds. Not to mention that CMake and I are not the best of friends.
My progress so far:
- Successfully built the extremely out of date nightly build readme instructions of version 0.11 x86
- Partial success in creating CMake output to VS2010, but many required headers were not included such as gqsmapcanvas.h, (So even if I got it building I couldn't use the canvas widget in an application)
*Note I updated the external packages to x64 versions, so it is not an architecture mismatch issue.
I have also had issues with QWT looking for QWT Polar header files, but I suspect this is another issue with the missing headers as most of the errors related to files contained in the original source from GIT.
View 1 Replies
View Related
Jul 1, 2014
I am studying C How to Program book and want to run GuessNumber Game.
My system command prompt gives C:UsersAcer>_. And GuessNumber path is C:UsersAcercode_examplesGuessNumberWindows.
I am getting below error after pressing enter. How I can run this program.
‘code_examplesch01GuessNumberWindows’ is not recognized as an internal or external command,operable program or batch file.
View 11 Replies
View Related
Dec 27, 2012
i am doing a structure program "struct book",but at the time of run cmd is opening and i am getting 'windows don't send' error and program has been terminating.
the code is following:
#include<stdio.h>
#include<conio.h>
display();
struct book
[Code]....
View 3 Replies
View Related
Apr 27, 2013
I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.
It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.
I've rebuilt all my libraries, but still no joy.
So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?
The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?
View 11 Replies
View Related
Sep 13, 2012
I need to copy a file from remote location.
I know following information.
a) Address of the remote file location
b) Port number
c) File Name
d) Size of file in bytes
How i copy the file from specified port/socket and write it to the file opened in local machine.
View 3 Replies
View Related
Apr 17, 2013
In my application I have some type of windows showed in an instance of time, and an action shows a new one that i want have the focus all the time , in the way that i can't works with no one of the others. They all are windows, child windows an modeless dialogs, but i don't know how to do. I try use EnableWindow(FALSE) that all the others windows and dialogs, but not works.
View 2 Replies
View Related
May 7, 2014
I would like to be able to safely eject a USB drive (in Windows) when user selects that drive in a listbox and clicks the Eject button in an MFC dialog app. Any functions or (link) that would be up to date (i.e. compatible with Windows 8)?
View 1 Replies
View Related