Put Things into Different Containers Depending on which Dialog Box Button Clicked - Sierra Chart Programming | futures io social day trading
futures io futures trading


Put Things into Different Containers Depending on which Dialog Box Button Clicked
Updated: Views / Replies:47 / 1
Created: by doughtrader Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Put Things into Different Containers Depending on which Dialog Box Button Clicked

  #1 (permalink)
Trading Apprentice
Paris, France
 
Trading Experience: None
Platform: Sierra Chart
Favorite Futures: Currency, crypto
 
Posts: 1 since Jan 2019
Thanks: 0 given, 0 received

Put Things into Different Containers Depending on which Dialog Box Button Clicked

Using: http :// win32-framework [dot] sourceforge [dot] net/description.htm

I'm trying to write a Sierra Chart plugin that uses a dialog box. I found some reference code (from right here: https :// futures [dot] io/sierra-chart-programming/45896-how-do-i-go-about-making-modeless-dialog-boxes-code-provided.html#post702140) that seems close to what I need (especially based on the rest of that forum thread), but I'm trying to change it to what I need. That is, a dialog box that comes when a shortcut menu item is clicked (that part is easy-peasy once I have the dialog implemented with the win32++ framework linked on the first line).

The dialog box takes text input. There are 3 buttons. An OK button, a button to click if you want the text input to go to a list called List_1, and a second button that puts the text input into a different list called List_2. At the moment, all I have is the design for this right here generated by Visual Studio:

From `NewTestDialog.rc`:

 
Code
    IDD_NEW_DIALOG DIALOGEX 0, 0, 215, 65
    STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "New SC DLL Dialog Test"
    FONT 8, "MS Shell Dlg", 400, 0, 0x1
    BEGIN
        DEFPUSHBUTTON   "OK",IDOK,158,37,50,14
        EDITTEXT        IDC_TEXT_INPUT,7,15,201,14,ES_AUTOHSCROLL
        PUSHBUTTON      "Buy Target",IDC_PUT_IN_CONTAINER_1,7,37,50,14
        PUSHBUTTON      "Sell Target",IDC_PUT_IN_CONTAINER_2,68,37,50,14
    END

Now, below is parts from the code reference I have that is relevant to me and that I'm having trouble with.

From `OldTestDialog.rc`:
 
Code
    IDD_DIALOG DIALOGEX 0, 0, 181, 61
    STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "Old SC DLL Dialog Test"
    FONT 8, "MS Shell Dlg", 400, 0, 0x1
    BEGIN
        DEFPUSHBUTTON   "ОК",IDOK,125,44,50,14
        EDITTEXT        IDC_EDIT1,7,7,167,14,ES_AUTOHSCROLL
        PUSHBUTTON      "Start Timer",IDC_BUTTON1,7,44,50,14
    END
From `OldTestDialog.h`:

 
Code
#pragma once
    #ifndef MYDIALOG_H
    #define MYDIALOG_H
    
    class CMyDialog : public CDialog
    {
    public:
    	CMyDialog(UINT nResID,s_sc* p_interface);
    	virtual ~CMyDialog();
    
    	void UpdateSCData();
    	s_sc* m_pSCInterface;
    
    protected:
    	virtual void OnDestroy();
    	virtual BOOL OnInitDialog();
    	virtual INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
    	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
    	virtual void OnOK();
    	virtual LRESULT SCTimer(UINT uMsg, WPARAM wParam, LPARAM lParam);
    
    private:
    	BOOL OnButtonStartTimer();
    	CEdit     m_Edit;
    };
    #endif
and from `OldTestDialog.cpp`:

 
Code
 #include "stdafx.h"
    #include "TestDialog.h"
    
    #define ID_SC_TIMER 110
    
    CMyDialog::CMyDialog(UINT nResID, s_sc* p_interface) : CDialog(nResID)
    ,m_pSCInterface(p_interface)
    {}
    
    CMyDialog::~CMyDialog()
    {
    	
    }
    
    void CMyDialog::UpdateSCData()
    {
    	m_Edit.SetWindowTextA(std::to_string(m_pSCInterface->Subgraph[0].Data[m_pSCInterface->Index]).data());
    	m_Edit.Invalidate();
    }
    
    void CMyDialog::OnDestroy()
    {
    	KillTimer(ID_SC_TIMER);
    	::PostQuitMessage(0);
    }
    
    INT_PTR CMyDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
    	UINT nID = (UINT)wParam;
    
    	switch (uMsg)
    	{
    		case WM_TIMER:
    		{
    			switch (nID)
    			{
    				case ID_SC_TIMER:return SCTimer(uMsg, wParam, lParam); break;
    			}
    		}
    		case WM_SYSCOMMAND:
    		{
    			switch (LOWORD(wParam))
    			{
    				case SC_CLOSE:
    				{
    					MessageBox("To Destroy this Dialog Window,\r\nyou have to remove study from chart!", "Warning!", MB_OK);
    					return TRUE;
    				}
    			}
    		}
    	}
    			
    	return DialogProcDefault(uMsg, wParam, lParam);
    }
    
    BOOL CMyDialog::OnCommand(WPARAM wParam, LPARAM lParam)
    {
    	UNREFERENCED_PARAMETER(lParam);
    
    	UINT nID = LOWORD(wParam);
    	switch (nID)
    	{
    		case IDC_BUTTON1:   return OnButtonStartTimer();
    	}
    
    	return FALSE;
    }
    
    BOOL CMyDialog::OnInitDialog()
    {
    	AttachItem(IDC_EDIT1, m_Edit);
    
    	return TRUE;
    }
    
    void CMyDialog::OnOK()
    {
    	MessageBox("To Destroy this Dialog Window,\r\nyou have to remove study from chart!", "Warning!", MB_OK);
    	return;
    }
    
    
    LRESULT CMyDialog::SCTimer(UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
    	UpdateSCData();
    	return FinalWindowProc(uMsg, wParam, lParam);
    }
    
    
    
    BOOL CMyDialog::OnButtonStartTimer()
    {
    	SetTimer(ID_SC_TIMER, 500, 0);
    	
    	return TRUE;
    }


How do I go about changing this implementation of CDialog so that it suits my needs better?

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply



futures io > > > > > Put Things into Different Containers Depending on which Dialog Box Button Clicked

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!

February
 

Trading Resolutions for 2019 - Avoiding Mistakes w/GFF Brokers

Feb 19
 

3 Excellent Entries, and How To Automate Them w/Kevin Davey

Feb 21
 

The Driving Force Behind the Market w/Earn2Trade

Mar 5
 

TBA w/Stage5 & iSystems

Mar 12
 

TBA w/John Grady @ No BS Day Trading

Mar 19
 

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I go about making modeless dialog boxes? Code Provided. doetrader Sierra Chart Programming 8 January 2nd, 2019 07:00 PM
choose bollinger bands' standard deviation depending the instrument alextrd NinjaTrader 8 December 21st, 2013 10:52 AM
Putting things into perspective rickey Traders Hideout 9 February 5th, 2012 11:54 PM
Things That Make You Go Hmmm.... Such As An Empty Box Filled With Promises Of Money, Quick Summary News and Current Events 0 October 30th, 2011 03:30 AM
How to put two different Data series on one chart or two panels? Buscador NinjaTrader 2 July 13th, 2011 10:07 PM


Tags
buy, c++, code, dow, futures, programming, sierra chart, sierra_chart, visual studio, warning, win32++

All times are GMT -4. The time now is 06:34 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2019-02-17 in 0.12 seconds with 13 queries on phoenix