C++ :: Making List Box With 2 Scroll Buttons

Oct 13, 2012

I want to make something like this for a game:

It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.

Needs to run crossplatform (windows, linux).

View 4 Replies


ADVERTISEMENT

C++ :: Making A List Box With Two Scroll Buttons

Oct 13, 2012

I want to make something like this for a game:

Attachment 30507

It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.

Needs to run crossplatform (windows, linux).

View 2 Replies View Related

C Sharp :: Scroll Images In Dicom Viewer Using Scroll Bar?

Aug 28, 2012

I want to know how to scroll images in dicom viewer using scroll bar control

View 1 Replies View Related

C++ :: Calculating Vertical Position Of Scroll Bar For A List Box?

Aug 16, 2013

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;

[code]....

Additional vars in the menu class:

MenuListBox* MenuListBoxes;
int ListBoxCount;

How could i calculate this:

New->CurrentScrollBarPosY = ; ?

View 15 Replies View Related

C Sharp :: Convert A List To Buttons

May 27, 2012

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>();

[Code] ....

View 1 Replies View Related

C :: Making Linked List From 2D Array

Nov 24, 2014

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.

View 1 Replies View Related

C++ :: Making Templated Class Of List?

Apr 19, 2014

I'm trying to make an templated class of List and trying to make a list of Students(another class) which I made. Its not working.

Code seems to work fine for pre-defined data types but it crashes when it comes to students. I also want to run sort function on list of students.

View 1 Replies View Related

C++ :: Making List Of Champions - Vector Of Class

Oct 6, 2013

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

[Code] ....

View 3 Replies View Related

C/C++ :: Making New Class Instance And Adding To Linked List

Oct 31, 2013

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?

View 3 Replies View Related

C Sharp :: Scroll To Top Of The Screen?

Jun 12, 2012

I have screen, where I need to scroll automatically top of the screen if any error comes.

View 1 Replies View Related

C Sharp :: How To Give Scroll Bar For Group Box

Oct 11, 2012

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

View 2 Replies View Related

C++ :: Code Blocks Horizontal Scroll Bar In Console

Oct 4, 2014

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?

View 3 Replies View Related

C++ :: 2D Side Scroll Game - Background Is Not Working Right

Dec 30, 2013

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]

View 3 Replies View Related

Visual C++ :: How To Scroll Text Drawn With DrawText

Apr 16, 2013

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.

Rich
[URL]...
[URL]...

View 3 Replies View Related

Visual C++ :: Get Cursor Position For Picture Control With Scroll Bar

Apr 25, 2014

I was loaded a bitmap using this code. I'm using mousemove method to known the Dialog's mouse move position & get the RGB pixel.

I want to get the picture contol's mouse move position & using this point (x,y) i will get the particular color ref value R, G, & B.

My picture control size is 256 * 256 & I was loaded an image 512 * 512.

Using scroll bar, I was view the image but can't get the particular pixel in the picture control.

The below code get the Dialog's mouse move cursor position & RGB Values only.

Code:
void CMyDlg::OnMouseMove(UINT nFlags, CPoint point) {
int R,G,B;
COLORREF ref;
ref = m_dcMem.GetPixel(point.x,point.y);
R = GetRValue(ref);
G = GetGValue(ref);
B = GetBValue(ref);
CButton::OnMouseMove(nFlags, point);
}

How can i get the picture contol position even use the scroll bar.

View 1 Replies View Related

Visual C++ :: How To Capture Mouse Scroll For CMFCRibbonEdit Class

Oct 18, 2014

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?

View 4 Replies View Related

C# :: How To Get AI To Look For Specific Buttons

May 5, 2014

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.

View 3 Replies View Related

C# :: How Add Buttons To Dialog Derived From GTK

Jul 31, 2014

I want write my first application using Xamarin Studio and GTK#.

I create new file Dialog.cs: public partial class Dialog : Gtk.Dialog

I add Fixed container and can't add buttons, why?

I must use class Window : Gtk.Window instead of Dialog and show modal this window?

View 2 Replies View Related

C# :: Buttons Won't Work On Al Tabs

Jun 24, 2014

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.

this is the code for the back en next buttons

private void btnback_Click(object sender, EventArgs e)
{
if (dataGridView1.CurrentRow.Index >= 1)
{

[Code]....

View 14 Replies View Related

C# :: Matrix Of Buttons Variables?

Jun 14, 2014

There is a genereted matrix of buttons:

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
}

View 9 Replies View Related

C++ :: Processing Buttons Created At Runtime

Oct 7, 2014

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?

View 6 Replies View Related

C/C++ :: Creating Many Push Buttons In Win32 API

Apr 13, 2014

I am pretty new to windows programming, but i get around with small applications.

Now I want to create a window with 10 push buttons, and was just wondering if there is some smart way, maybe in a loop to create multiple buttons.

Also, on a very populated window, is there a way to maybe have the WM_CREATE commands stowed away in another cpp file? Just for readabilty.

View 13 Replies View Related

C# :: Create GUI Application That Can Resize Also Control Buttons?

May 23, 2012

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

View 3 Replies View Related

Visual C++ :: Create A Column Of Buttons In A ListView?

Mar 26, 2013

Is there an easy way to create a column of buttons ina listView?

I need that every file of the listView has a button in the first cell. Is that possible?

View 2 Replies View Related

Visual C++ :: How To Increase Font Size In Buttons

Jan 15, 2014

How to increase font size for a specific button? I tried to change the nHeight but it doesn't seems to change the font size.

Code:

CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_REGULAR, // nWeight

[Code] ....

View 3 Replies View Related

Visual C++ :: Can Overlapped Buttons Both Receive Notification

Oct 17, 2013

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.

View 10 Replies View Related







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