Author |
Topic  |
|
couturier
France
291 Posts |
Posted - 02/22/2020 : 4:59:53 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): 2020 Operating System: win10
I have a getn dialog with which I will do various operations on a custom report wks. While dialog is open, I'd like to scroll that wks up and down to check things.
wks_scroll_into_view() kind of works but is not good.
It seems to me I could do this with window::setscrollpos, that I would control with getn_slider I've tried to play with it and getscrollrange but couldn't succeed
Otherwise, is there any option so that getn would be non modal, so I can access wks and review it ?
Thanx |
|
nick_n
Finland
125 Posts |
Posted - 02/22/2020 : 6:01:07 PM
|
Hi Couturier, Personally for me GETN_BOX(trGetN) GETN_INTERACTIVE works perfect . I do not really get any range selection from it but that allows to navigate anywhere (not elegant?). Regards,
Nikolay |
 |
|
couturier
France
291 Posts |
Posted - 02/23/2020 : 05:17:21 AM
|
Hi Nikolay,
thanks for that trick. But I don't want to show an additional item in my dialog.
I'm wondering if it's possible to use Dialog::Create to make the getn modalless. Or if I can show a _ icon in title bar (left to X icon) so I can roll up the dialog and access the wks, just like in nonlinear curve fit dialog |
Edited by - couturier on 02/23/2020 05:27:50 AM |
 |
|
couturier
France
291 Posts |
Posted - 02/23/2020 : 08:34:34 AM
|
Another thing came to my mind: I can show a scrollbox in the getn:
HWND hh = GetWindow(OGW_DB_ACTIVE_DLG);
Window wnd(hh);
wnd.SetScrollRange( SB_VERT, 0, 50 ); Maybe this scrollbox could be linked to that in the wks:
Worksheet wks = Project.ActiveLayer();
WorksheetPage wksPg;
wks.GetParent(wksPg);
Window winWks = wksPg.GetWindow();
int nMinPos, nMaxPos;
winWks.GetScrollRange( SB_VERT, nMinPos, nMaxPos ); I could set the same scroll range in the getn. Moving the scroll bar in getn would move the wks with;
winWks.SetScrollPos( SB_VERT, wnd.GetScrollPos(SB_VERT)); However, nMinPos and nMaxPos don't get the wks scroll range :(
Is it something that can work ? |
 |
|
nick_n
Finland
125 Posts |
Posted - 02/24/2020 : 12:45:48 PM
|
Do you mean something like: BOOL Rollup( BOOL bClose = TRUE )?
Nikolay |
 |
|
couturier
France
291 Posts |
Posted - 02/24/2020 : 2:24:43 PM
|
quote: Do you mean something like: BOOL Rollup( BOOL bClose = TRUE )?
EXACTLY However, the dialog class is poorly documented. Do you know how to use ? |
 |
|
nick_n
Finland
125 Posts |
Posted - 02/24/2020 : 5:55:02 PM
|
Hi, Seems, you have to use HTMLDlg. Unfortunately, I have only little expirience in that class. I found some examples of using in "C:\Users\...\AppData\Local\OriginLab\Apps". Pay attention to: ModifyStyle(0, WS_MAXIMIZEBOX|WS_MINIMIZEBOX);, it is your case. Regards,
Nikolay |
 |
|
Castiel
343 Posts |
Posted - 02/24/2020 : 7:18:25 PM
|
quote: Originally posted by couturier
Hi Nikolay,
thanks for that trick. But I don't want to show an additional item in my dialog.
I'm wondering if it's possible to use Dialog::Create to make the getn modalless. Or if I can show a _ icon in title bar (left to X icon) so I can roll up the dialog and access the wks, just like in nonlinear curve fit dialog
GetN dialog cannot be modeless. You may create one from resource dll.
However, if GetN is the preferred option and you can stand the dialog position, just hack a modeless one like this:
#include <origin.h>
#include <GetNBox.h>
static bool hackEvent(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)
{
if(nType < 0)
return false;
Window dlg(dlgGetNBox);
dlg.SendMessage(WM_CLOSE);
return false;
}
void MakeGetNModeless()
{
GETN_TREE(hack)
GetNBox(hack, NULL, NULL, NULL, hackEvent);
return;
}
static bool gtEvent(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)
{
if(nRow < 0)
{
MakeGetNModeless();
return false;
}
return false;
}
void foo()
{
GETN_TREE(gt)
if(GetNBox(gt, NULL, NULL, NULL, gtEvent))
{
}
return;
}
&&&&&&&&&
&&&
&&
& _____ ___________
II__|[] | | I I |
| |_|_ I I _|
< OO----OOO OO---OO
**********************************************************
|
 |
|
couturier
France
291 Posts |
Posted - 02/25/2020 : 11:52:03 AM
|
Thanx a lot Castiel for this hack
Is there any event that could tell me if user has selected another window ?
|
 |
|
Castiel
343 Posts |
Posted - 02/25/2020 : 8:32:00 PM
|
quote: Originally posted by couturier
Thanx a lot Castiel for this hack
Is there any event that could tell me if user has selected another window ?
There may or may not be such an event of GetN dialog I've no idea of.
According to the description, I deem this is the right time you create your own dialog instead of using GetN.
If you are trying to create a dialog similiar to the Column Properties dialog, press shift+alt+O in Code Builder to open ColumnProperties.h in which you will find
ON_CHANGE_LAYER( OnChangeLayer )
ON_CHANGE_PAGE( OnChangePage )
ON_CHANGE_SELECTION( OnSelectionChange )
ON_CHANGE_DATASET(OnChangeDataset )
The implementation is in ColumnProperties.c
&&&&&&&&&
&&&
&&
& _____ ___________
II__|[] | | I I |
| |_|_ I I _|
< OO----OOO OO---OO
**********************************************************
|
 |
|
couturier
France
291 Posts |
Posted - 02/26/2020 : 7:21:58 PM
|
 I think that scroll thing will wait |
Edited by - couturier on 02/26/2020 7:22:32 PM |
 |
|
|
Topic  |
|