Allow incrementing different parts of strings with modifiers
Primary increment is the right most bit, secondary is the next rightmost. So you can increment 'A1' to 'A2' or 'B1' with Shift-Alt-Scroll and Ctrl-Alt-Scroll respectively.
This commit is contained in:
+4
-19
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <array_axis.h>
|
||||
|
||||
#include <increment.h>
|
||||
|
||||
|
||||
/**
|
||||
* @return False for schemes like 0,1...9,10
|
||||
@@ -134,26 +136,9 @@ wxString ARRAY_AXIS::GetItemNumber( int n ) const
|
||||
{
|
||||
wxString itemNum;
|
||||
const wxString& alphabet = GetAlphabet();
|
||||
|
||||
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( m_type );
|
||||
|
||||
bool firstRound = true;
|
||||
int radix = alphabet.Length();
|
||||
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( m_type );
|
||||
|
||||
n = m_offset + m_step * n;
|
||||
|
||||
do
|
||||
{
|
||||
int modN = n % radix;
|
||||
|
||||
if( nonUnitColsStartAt0 && !firstRound )
|
||||
modN--; // Start the "tens/hundreds/etc column" at "Ax", not "Bx"
|
||||
|
||||
itemNum.insert( 0, 1, alphabet[modN] );
|
||||
|
||||
n /= radix;
|
||||
firstRound = false;
|
||||
} while( n );
|
||||
|
||||
return itemNum;
|
||||
return AlphabeticFromIndex( n, alphabet, nonUnitColsStartAt0 );
|
||||
}
|
||||
Reference in New Issue
Block a user