Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e3894962
Commit
e3894962
authored
Jan 18, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print dialogs remember their position and size.
parent
82a7e0b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
0 deletions
+101
-0
dialog_print_using_printer.cpp
eeschema/dialog_print_using_printer.cpp
+33
-0
dialog_print_using_printer.cpp
gerbview/dialog_print_using_printer.cpp
+32
-0
dialog_print_using_printer.cpp
pcbnew/dialog_print_using_printer.cpp
+36
-0
No files found.
eeschema/dialog_print_using_printer.cpp
View file @
e3894962
...
...
@@ -43,6 +43,8 @@ class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_base
private
:
WinEDA_SchematicFrame
*
m_Parent
;
wxConfig
*
m_Config
;
static
wxPoint
s_LastPos
;
static
wxSize
s_LastSize
;
public
:
DIALOG_PRINT_USING_PRINTER
(
WinEDA_SchematicFrame
*
parent
);
...
...
@@ -56,6 +58,8 @@ private:
void
OnPrintButtonClick
(
wxCommandEvent
&
event
);
void
OnButtonCancelClick
(
wxCommandEvent
&
event
){
Close
();
}
void
SetPenWidth
();
bool
Show
(
bool
show
);
// overload stock function
};
...
...
@@ -89,6 +93,10 @@ public:
void
DrawPage
();
};
// We want our dialog to remember its previous screen position
wxPoint
DIALOG_PRINT_USING_PRINTER
::
s_LastPos
(
-
1
,
-
1
);
wxSize
DIALOG_PRINT_USING_PRINTER
::
s_LastSize
;
/* Virtual function
* Calls the print dialog for Eeschema
...
...
@@ -147,6 +155,31 @@ void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event )
}
}
/*************************************************/
bool
DIALOG_PRINT_USING_PRINTER
::
Show
(
bool
show
)
/*************************************************/
{
bool
ret
;
if
(
show
)
{
if
(
s_LastPos
.
x
!=
-
1
)
{
SetSize
(
s_LastPos
.
x
,
s_LastPos
.
y
,
s_LastSize
.
x
,
s_LastSize
.
y
,
0
);
}
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
else
{
// Save the dialog's position before hiding
s_LastPos
=
GetPosition
();
s_LastSize
=
GetSize
();
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
return
ret
;
}
void
DIALOG_PRINT_USING_PRINTER
::
OnCloseWindow
(
wxCloseEvent
&
event
)
{
...
...
gerbview/dialog_print_using_printer.cpp
View file @
e3894962
...
...
@@ -48,6 +48,8 @@ private:
WinEDA_GerberFrame
*
m_Parent
;
wxConfig
*
m_Config
;
wxCheckBox
*
m_BoxSelectLayer
[
32
];
static
wxPoint
s_LastPos
;
static
wxSize
s_LastSize
;
public
:
DIALOG_PRINT_USING_PRINTER
(
WinEDA_GerberFrame
*
parent
);
...
...
@@ -64,12 +66,17 @@ private:
void
SetPrintParameters
(
);
void
InitValues
(
);
bool
Show
(
bool
show
);
// overload stock function
public
:
bool
IsMirrored
()
{
return
m_Print_Mirror
->
IsChecked
();
}
bool
PrintUsingSinglePage
()
{
return
m_PagesOption
->
GetSelection
();
}
int
SetLayerMaskFromListSelection
();
};
// We want our dialog to remember its previous screen position
wxPoint
DIALOG_PRINT_USING_PRINTER
::
s_LastPos
(
-
1
,
-
1
);
wxSize
DIALOG_PRINT_USING_PRINTER
::
s_LastSize
;
/*******************************************************/
...
...
@@ -209,6 +216,31 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
m_FineAdjustYscaleOpt
->
SetValue
(
msg
);
}
/*************************************************/
bool
DIALOG_PRINT_USING_PRINTER
::
Show
(
bool
show
)
/*************************************************/
{
bool
ret
;
if
(
show
)
{
if
(
s_LastPos
.
x
!=
-
1
)
{
SetSize
(
s_LastPos
.
x
,
s_LastPos
.
y
,
s_LastSize
.
x
,
s_LastSize
.
y
,
0
);
}
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
else
{
// Save the dialog's position before hiding
s_LastPos
=
GetPosition
();
s_LastSize
=
GetSize
();
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
return
ret
;
}
/**************************************************************/
int
DIALOG_PRINT_USING_PRINTER
::
SetLayerMaskFromListSelection
()
...
...
pcbnew/dialog_print_using_printer.cpp
View file @
e3894962
...
...
@@ -47,6 +47,8 @@ private:
wxConfig
*
m_Config
;
wxCheckBox
*
m_BoxSelectLayer
[
32
];
static
bool
m_ExcludeEdgeLayer
;
static
wxPoint
s_LastPos
;
static
wxSize
s_LastSize
;
public
:
DIALOG_PRINT_USING_PRINTER
(
WinEDA_PcbFrame
*
parent
);
...
...
@@ -63,6 +65,8 @@ private:
void
SetPenWidth
();
void
InitValues
(
);
bool
Show
(
bool
show
);
// overload stock function
public
:
bool
IsMirrored
()
{
return
m_Print_Mirror
->
IsChecked
();
}
bool
ExcludeEdges
()
{
return
m_Exclude_Edges_Pcb
->
IsChecked
();
}
...
...
@@ -71,6 +75,10 @@ public:
};
bool
DIALOG_PRINT_USING_PRINTER
::
m_ExcludeEdgeLayer
;
// We want our dialog to remember its previous screen position
wxPoint
DIALOG_PRINT_USING_PRINTER
::
s_LastPos
(
-
1
,
-
1
);
wxSize
DIALOG_PRINT_USING_PRINTER
::
s_LastSize
;
...
...
@@ -114,6 +122,8 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_PcbFrame* parent
{
GetSizer
()
->
SetSizeHints
(
this
);
}
Center
();
}
...
...
@@ -244,6 +254,32 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
}
/*************************************************/
bool
DIALOG_PRINT_USING_PRINTER
::
Show
(
bool
show
)
/*************************************************/
{
bool
ret
;
if
(
show
)
{
if
(
s_LastPos
.
x
!=
-
1
)
{
SetSize
(
s_LastPos
.
x
,
s_LastPos
.
y
,
s_LastSize
.
x
,
s_LastSize
.
y
,
0
);
}
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
else
{
// Save the dialog's position before hiding
s_LastPos
=
GetPosition
();
s_LastSize
=
GetSize
();
ret
=
DIALOG_PRINT_USING_PRINTER_base
::
Show
(
show
);
}
return
ret
;
}
/**************************************************************/
int
DIALOG_PRINT_USING_PRINTER
::
SetLayerMaskFromListSelection
()
/**************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment