im trying to code a simple list box for my self made GUI but i seem to be stuck at the scroll bar. I already finished with the calculation for the scroll bar size but how I could calculate it's current vertical position depending on the current item on top of the list box.
My current code looks like this
ListBox struct: struct MenuListBox { int PosX; int PosY; int Width; int ItemsVisible; //Items visible at the same time int CurrentItem;
I have a txt file of drinks, and I want to meak a list of buttons of it (the txt file is build like this: fanta : 2 ), how can I make buttons of all the drinks ( I get the first one in a button , but not the others).
Dictionary<string, double> drank = new Dictionary<string, double>(); string[] words = new string[8]; Button button; <Button> BtnList = new List<Button>();
I have a 2D array, array[20][3]. Each row represents a storm and each column represents month #, wind speed, and pressure in that order. This data is read from a file and auto-fills the array. I need to be able to give users the ability to add an additional storm or delete a storm. I know that a linked list would be the best approach but I'm not very familiar with linked lists.
I am making a simple program that is suppose to make a list of champions and their items from the game League of Legends. I am stuck on making a vector of the class so each slot within the vector would hold each champion and its data. This is what I got:
Champion_Info.h
#ifndef CHAMPION_INFO_H_INCLUDED #define CHAMPION_INFO_H_INCLUDED #include <vector> #include <string> using namespace std; class Champ_Info
I have a .cpp file which contains 5 smaller defined classes. In my missile class I have a default constructor and a constructor that I invoke
class Missile{ private: bool isHuman;
[Code]...
My issue is when creating and adding the pointer object; it doesn't seem to create a new instance of the class-the Missile objects all share the same xPos value which is always the first xPos when the "fire" command is given. The "Missile *missile = new Missile(xPos, yPos, true);" line does not seem to create a new instance of the object with different variables but instead creates a new object with the same variables. Is it necessary for me to always make a separate .cpp and .h file for any class I want to create multiple instances of or can I keep the smaller classes in the same file and still create a new separate instance of the class?
Is there any methods to add scroll bar for group box
My code scenerio is: I have many groupbox in form, all group box will be appears in same place and also height and width is fixed. I'm doing group box visible true/false according to condition.
So some groupbox ecxeeds the width and heighto so I want to put this all in scroll Bar
I want to show my output in one line. But my output breaks to next line even before endl is encountered.code blocks horizontal scroll bar in console? is it c++ formatting issue or console issue?
I am working on a 2D side scroller game. Where a ball is moving continuously towards right . I used a camera to follow the ball as soon as ball reaches the center of screen. I created a horizontal line to look like the surface on which the ball is rolling.
line runs from x=0 to x=800 (i.e screen width)
NOTE: (0,0) coordinate is at top left corner of display.
Problem: My display is 800 x 400 . Camera follows the ball, but soon the ball crosses x=800 and starts moving in black background. I want that line surface to stay there instead of going out of bound.
Additionally! I generated obstacles from x=800 which also move out of bound along with my line.
What should be done here? This is just my first c++ game project, so i might be skipping things that can solve the issue.
[Update] these screenshots manage to show, what the real problem is: [URL]
I have an emulation project I've been working for a long time (the Altair32 Altair/IMSAI emulator) and I'm trying to simulate a dot-matrix printer for list output in CP/M.
Here's what I have so far and where I'm stuck and need a push in the right direction. I'm using a dialog box with a green bar paper bitmap as the client area background. I used CreateFont to load a dot matrix printer TrueType font and have the base code to print on subsequent lines. So, based on the dialog size, font size, etc., I get about 10 lines of dot matrix printing, 80-characters wide. So far so good.
The problem arises in how do I scroll the text like on a printer? I thought about trying a static text control or an edit box, but the text to be printed is of an unknown size and ISTR that both of those controls have finite size limits (32k but maybe I'm wrong). They would also need to be transparent so that the green bar paper shows through.
For a ribbon bar with edit controls (CMFCRibbonEdit) I want to handle the mouse scroll events for the edit controls. That is, when the user clicks and then scrolls on the edit it will navigate a predefined list of strings. I want to capture the scroll event in order to update the edit text step by step.
This kind of behavior is implemented by the Spin Edit; I don't want to use the spin edit control since it only uses a list of integers and the spin buttons are too small.
Is there a way to catch the mouse scroll event for the CMFCRibbonEdit control? How to approach message handling for the ribbon (other messages than the COMMAND allowed by the ribbon designer). I'm using VS2010 on Windows 7 and the ribbon was designed with the ribbon designer?
Basically I am creating a game and I need the ai to look for specific buttons. At the moment this is the code I have, and what it does is it makes the ai look for any random button that has't already been clicked.
Code:
private Button look_for_spaces() { Console.WriteLine("Looking for spaces"); Button b = null; foreach (Control c in Controls) { b = c as Button; // performs a cast
[Code] .....
Now what I'm trying to do is make the ai go through 4 searches in steps instead of looking for any button. I want it first to look for buttons 1, 2 and 3, if there's a space in any then it will be clicked but if all of them are already clicked it will look for spaces in buttons 4, 5 and 6 and so on if that makes sense. But i'm not too sure how I would do it.
The opjective was to build an c# deskop windows application for an classic car sales company.
My job was the employees section of the application.
my problem is the following
i have 3 tabs summary (overzicht) details mutation (muteren)
on the details tab i have 2 buttons and a search box both the buttons only do somthing on the summary tab where they also need to take the selected row to the field on the other tabs.
the search box is a text box that neds to find the valve in the summary tab and then als so select the full row and put it in the onther 2 tabs fields.
private void Single_Load(object sender, EventArgs e) { //code here for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { //a lot of working code here b[i, j].Click += new System.EventHandler(ClickButton); } } }
What can I do when one of those buttons is pressed (i have the method ClickButton) to know what i and j has he?
I want to make something like this
ClickButton() { if (x%2==0) v[i, j] = x; //i and j should be form the matrix of buttons }
I am developing a small game using MFC in which the game options like new game, save, open, exit etc. can be selected from the menu as well as from the buttons inside the window. I have no problems with the menu but the buttons do not seem to work at all.
The buttons are created at runtime using CButton class. To associate the buttons with the corresponding functions, I just used the same resource ID for the buttons as the menu options, but that did not work. When I click on the buttons, nothing happens. If I assign different resource IDs to the buttons, how do I handle the message map entries? Do I have to write different message map entries for the menus and the buttons while their function is exactly the same?
how can I create a GUI application that can resize also the control buttons. If the user decide to make the windows bigger or smaller I would like my textbox, buttons, etc.. to follow. Like in Java they use a layout manager, but I can't seem to find the answer for c#. I though to use table layout panel, but it doesn't expand when expanding the windows, unless i miss something
I have multiple bitmap buttons of non-square shape. Because of their odd shape I can overlap them and they will still look good on screen, which is what I want - that certain layout.
The problem is that because underlying button in reality is square (which I am subclassing), the bitmap of one button may overlay with the non-bitmap area of the other button (in the underlying square). This means that 2nd bitmap button will not receive notification because the press is registered with top level window only.
Is there a way that both windows can receive the notification and check if they are in the hot spot, they will respond? I know this is against windows design.