C++ :: Resizing Widget - Change Size Of MainWindow During Runtime

Aug 31, 2012

I have QTextEdit in mainWindow. I'm trying to resize QTextEdit so height = mainwindow.height and width = height/2. That should change when I change the size of mainWindow during runtime. How can I do that?

View 2 Replies


ADVERTISEMENT

Visual C++ :: Change Frame Window Size According To Increase In Font Size

Nov 27, 2012

Change the frame window size according to font size increases.

View 3 Replies View Related

C++ :: How Do Games Change Meshes At Runtime

Jun 25, 2014

Right, I'm making a game and I'm not sure how I'm going to do this:

On Skyrim (for example; there are thousands of others), when you equip a helmet, it appears on your character's mesh.

How do they do that? Do they modify the mesh, or simply render the helmet at a location which makes it look like it is on their head, or what?

View 2 Replies View Related

Visual C++ :: How To Change Client Area Icon During Runtime

Feb 23, 2015

how to change the mouse tracking icon during runtime. I wish to emulate the Microsoft Paint app behavior with respect, for example, to click on a toolbar button such as the 'Fill With Color' bucket and have the mouse pointer icon change to a little bucket. I wish to do this in an MFC SDI app.

Here's a bit of code that does nothing that I can tell, although it compiles and runs. (m_hIcon2 is a member HANDLE, IDI_FLOODFILL is an existing icon in the app resources). I have come across numerous other examples that do not work and/or will not compile using VS 2010 Win7(64).

Code:
void CMainFrame::SetNewIcon() {
m_hIcon2 = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_FLOODFILL));
SetIcon(m_hIcon2, FALSE);

[Code].....

View 8 Replies View Related

C++ :: How To Change Font Size

May 19, 2013

how am i supposed to alter font size of text which appear in output screen?

View 1 Replies View Related

C/C++ :: How To Change CMD Window Size (No Properties)

Oct 23, 2014

Is there any way to resize the cmd window?

Kinda like in properties, where you choose the height and width of the window, but in actual code. So everybody who open my program see the same window.

View 1 Replies View Related

Visual C++ :: Disable Controls And Change Window Size

Jun 6, 2013

I have created an exam environment for our schools, it comprises of 3 files; a .kix file that says if they are in the examination group run a .vbs file. The .vbs file kills the explorer.exe task so they don't have any taskbar or desktop shortcuts and then opens a .hta file.

The .hta file is a user interface that has icons for apps like Win Word that executes the application when you click on it. There is also a log off button.

Looking for some code that stops the students from being able to close, minimise and resize the window. Looking for code that can lock this down so they literally can't do anything except click the icons inside the window.

View 3 Replies View Related

Visual C++ :: Change Menu Bar Font Size In Mainframe

Jul 30, 2014

Can change the menu bar font size in CMainFrame::OnCreate()? Here's what I have:

Code:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {
CRect rect;
GetClientRect(&rect);
if (CFrameWnd::OnCreate(lpCreateStruct) == -1) {
return -1;

[Code] ....

The line "m_wndToolBar.SetFont(&m_font);" does nothing.

View 2 Replies View Related

C++ :: Passing 2D Array To A Function Where Size Of Array Is Not Known At Runtime

Jun 27, 2014

I'm wondering if it is possible to pass a 2d array to a function where the size of the array is not known at runtime.

I've tried

function ( array[][6] ) ;

But the size of the array has to be constant so it cannot be declared later.

I've tried using a template but you still have to declare the size of the array at runtime. Is this even possible at all?

The only other way I can think of is using a dynamic 2d array but how to create one and manipulate it.

View 2 Replies View Related

C/C++ :: QHBox Spacing Proportional To Widget?

May 1, 2014

I have an QHBoxLayout that includes two QLabel Widgets. My left QLabel is much larger than my right QLabel, however, the QHBoxLayout is splitting the output in half, so the left side of the layout is too small and the right side of the layout is too big. How do I modify the QHBoxLayout to create unequal proportioned space for each included widget?

View 1 Replies View Related

C++ :: Widget That Implement Some Matrix Functions Using Data From A Text File

Dec 3, 2014

I need to write a widget that will implement some matrix functions using data from a text file. The input data will be spreadsheet like and fully determined with complete rows and columns. I need to do the following,

1. populate a data structure with the input data (double) to create matrix x
2. transpose the input data matrix x to create x'
3. multiply x * x' to create a square matrix x'x
4. take the determinant of x'x

This is pretty standard linear algebra, but not something I have done in cpp before. Implementation such as the best data types to use to store each of the three matrices, how they are sized, and what library functions may be available for the matrix functions like transpose, multiply, determinant, etc.

I will be removing each data row from the initial input to observe the effect on the determinant in case that has any effect on program design.

View 5 Replies View Related

C++ :: Dynamically resizing Array

Mar 27, 2013

int size = 10;
int* arr = new int[size];

void resize() {
int* resize_arr = new int[size + 1];

[Code] ....

i came across this code to dynamically resize an array...and here in the last statement they have deleted resize_arr.As resize_arr and arr points to samething...i think that memory that arr pointing to is also deleted...i guess correct thing would be delete [] arr....before we assign resize_arr pointer to arr...!! i am new to c++...

View 7 Replies View Related

C++ :: Making Array Bigger - Resizing?

Feb 20, 2013

As part of class project I'm working with the following code...

Item.h

#ifndef ITEMH
#define ITEMH

#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>

[Code] ...

The plan is to add a new method 'resize' where a new array will copy the contents of the first original array and modify the already existing 'add' method to call 'resize' when necessary.

Up till now, in the constructor I created the new array, should I give the array a default value?

View 5 Replies View Related

Visual C++ :: Repaint On CDockablePane Resizing

Jul 13, 2013

I have a tabbed CDockablePane with 3 Panes in total lets say Pane1 is main pain and Pane2 and Pane3 are added to the Main pain with AttachToTabWnd. In each pain I have 1 control but I will also eventually add a toolbar as well. I have created a CListCtrl with each pane. I call Override OnSize to resize the ListCtrl when the pane resizes. Problem is when I resize the width (enlarge) it does not update. If I drag the right border 1 pixel to the left it does update correctly. I have tried invalidating the pane after resize but still does not update as it should. What can I do to remedy this?

View 3 Replies View Related

C++ :: Dynamically Resizing Array While Program Is Running?

Feb 4, 2015

I'm working the 4th problem in chapter 14 of the Jumping into C++ book. In the book, he gives an example program for dynamically resizing an array while the program is running. It works fine for integer types but i need to do the same with a string type array. Right now my program is crashing because the string array is not resizing itself. Here's the part of the code im trying to figure out. The part for the int array has been ignored using // since it works fine and I'm trying to figure out whats wrong with the string array.

Code:
#include <iostream>
#include <string>
//Write a program that lets users keep track of the last time they talked to each of their friends.
//Users should be able to add new friends (as many as they want!) and store the number of days ago

[Code]......

View 8 Replies View Related

C/C++ :: Rectangle Not Resizing Properly - Odd Multiplication Result

May 28, 2014

I'm having some issues understanding why the "rectangle" in the following code isn't resizing properly. Here's the code:

#include <iostream>
using namespace std;
class Rectangle {
public:
Rectangle(double w, double h, double f)
: width(w), height(h), factor(f)

[Code] .....

I tested the code with a simple multiplication factor of "2", which should result in a new width and height of 4, but instead I get an odd value that seems be close to 4.

Output:

Numerically enter the width of the rectangle: 1
Numerically enter the height of the rectangle: 1

The width of the rectangle is: 1
The height of the rectangle is: 1
The area of the rectangle is: 1
The perimeter of the rectangle is: 4

Numerically enter a number to resize the rectangle: 2

The width of the rectangle after resizing is: 2.07408e-317
The height of the rectangle after resizing is: 2.07408e-317

View 2 Replies View Related

C/C++ :: Resizing Matrix And Zero-parameter Class Member

Sep 19, 2014

I'm attempting to make a matrix class, and so far I've made a member that can make a vector of vectors, but I'm not sure how to go about resizing the vectors if need be.

EX: resizeArray(3,3) should return a 3x3 vector.

Also, for some reason when I call my default member, matrix(), I get an error that says.. "Request for member numrows in myMatrix, which is of type matrix<int>[][]"

#include <iostream>
#include <vector>
using namespace std;

[Code].....

View 1 Replies View Related

C/C++ :: Insert Number Of Elements From One Into Another Vector Without Resizing

Dec 28, 2012

I think std::copy appears to do what I'm looking for.

I'm in need of a vector member function that would allow me to "insert" a number of elements from one vector into another vector without resizing or destroying either.

An example of what I'm wanting to do is assign the contents of two[3-5][50-54] to one[7-9][2-6]. Other than looping through both vectors using .at(), is there a way to copy this?

This would be continuous within a user controlled loop with differing elements being exchanged.

typedef vector<vector<unsigned char> > vec;  
vec one(10, vector<unsigned char>(10, '1')),
    two(90, vector<unsigned char>(90, '2'));  

View 4 Replies View Related

Visual C++ :: Direct2D - Auto-resizing Bitmaps

Feb 9, 2013

Apparently the default behavior with Direct2D when rendering is to scale everything I render based on the size of the render target/window. How can I prevent this? I want to decide for myself when to scale the image, regardless of the size of the window.

View 1 Replies View Related

Visual C++ :: Resizing Controls And Text Content

Sep 11, 2013

I have a SDI application that uses a CFormView class to create a window and this window has 2 buttons and 2 edit boxes.

I can resize this window, like minimize and maximize, but the controls all stay at the same place.

I know that it's possible to move the controls based on window size.

But what i want to do is, as the window is expanded the controls and it's text content to grow proportionally and same when the window is shrinked.

Is that possible to do? i.e., increase/decrease size of controls and texts per window size.

View 2 Replies View Related

C# :: Resizing Panel Controls On A Maximized Form (VS2008)

Mar 1, 2014

I made one application in Visual Studio 2008. The main form is maximized, and contains many panels with different controls (like buttons, listboxes, etc,). All the controls have the dock option fixed as true in panels, and the panels occupied the whole area of form.

Now, when I try to run this application in a machine, with different resolution of the screen, the form is maximized (naturally), but the panels are not resizing, so the form has many null area. How can I resize the panel so, that they fill the whole form area?

View 4 Replies View Related

C++ :: Coin / Money Change Code Doesn't Give Exact Change

Feb 20, 2013

My coin/money change code works when there can be an exact change each time, i.e. when the 1 cent option is available. However, when the change options are only $10, $5, $1, 25 cents and 10 cents, it does not give me what I want for instance, I wanted to get change for $237.80, I was expecting to get:

23 10's, one 5, two 1's and 8 dimes. However, the code below is giving me 23 10's, one 5, two 1's and 3 quarters (there is no option left for the 5 remaining cents).how to fix it?

Code:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
void change(double cents, int a[]);
int main() {
double Dollars;
double cents;

[code]...

View 14 Replies View Related

Visual C++ :: Text Size In Screen Is Different From Size In Print Preview?

Feb 1, 2013

I must take an old MFC project in VC++ 6.0 and make changes.

The problem is text size in screen is different from size in print preview.

for example with this font

Code:
CFont f50;
f50.CreateFont(100,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,"Frutiger LT Std 45 Light");

And this text

Code:
s=_T("Let's try to calculate the size of this text");

and with MM_LOMETRIC map mode

GetTextExtent() returns me:

On screen: (1595,99)
Ink printer + print preview: (1589,100)
PDFCreator + print preview: (1580,100)

comparing with screen size the height is bigger but lenght is smaller. I don't understand.

I can understand that different printers process the fonts in different way and then to have different lenghts. That's not the problem. The problem is I need to simulate in screen the same behaviour i will have on printer because these texts are being aligned in the document, and I don't want to see that the text si aligned different in text than in paper.

What can I do to render the text on screen with the same size I will have on the printer? Print preview is doing it. Should I change the font parameters? is something related with pixels per inch?

View 4 Replies View Related

C :: Why Size Of Struct Is Larger Than Sum Of All Size Of Its Members

Jul 11, 2013

I was wondering why, in C, the sizeof of a struct is larger than the the sum of all the sizeofs of it's members. It only seems to be by a few bytes, but as a bit of a perfectionist I fine this a bit annoying.

View 1 Replies View Related

C++ :: Why It Is Runtime Polymorphism

Apr 4, 2013

class Base
{
.....
.....
.....
virtual void display();

[code]....

in the above polymorphism why is it called runtime polymorphism when i can say seeing the code itself that display() function in derived gets executed with ptr->display(),so how does it become runtime polymorphism when i could get decide at compile itself ???

View 6 Replies View Related

C++ :: Runtime Stack Overflow

Jun 5, 2013

Here is my error message: Warning1warning C4717: 'getx' : recursive on all control paths, function will cause runtime stack overflow

and here is my code I will Bold the part that is giving me problems!

class point
{
public:
point();

[Code]....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved